Re: [Haskell-cafe] Haskell and the Software design process

2010-05-04 Thread John Lato
From: Rafael Cunha de Almeida assina...@kontesti.me Ivan Miljenovic ivan.miljeno...@gmail.com disse: On 3 May 2010 14:17, aditya siram aditya.si...@gmail.com wrote: I'm a little confused about this too. I've seen many functions defined like: f x = (\s - ...) which is a partial function

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-04 Thread John Lato
On Tue, May 4, 2010 at 2:09 PM, Limestraël limestr...@gmail.com wrote: 2010/5/4 John Lato jwl...@gmail.com Crashing at the point of the error isn't necessarily useful in Haskell due to lazy evaluation.  The code will crash when the result of the partial function is evaluated, which may

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-04 Thread John Lato
On Tue, May 4, 2010 at 5:31 PM, Gregory Crosswhite gcr...@phys.washington.edu wrote: Yes, but I think that it is also important to distinguish between cases where an error is expected to be able to occur at runtime, and cases where an error could only occur at runtime *if the programmer

Re: [Haskell-cafe] lazy-vs-strict, recursive IO (was: memory needed for SAX parsing XML)

2010-04-23 Thread John Lato
(changed the thread title hoping to get some others to weigh in on the recursive I/O scheme presented here) From: Daniil Elovkov daniil.elov...@googlemail.com John Lato wrote: Another (additional) approach would be to encapsulate unsafeInterleaveIO within some routine and not let it go out

Re: [Haskell-cafe] Proper Handling of Exceptional IEEE Floating Point Numbers

2010-04-23 Thread John Lato
From: Barak A. Pearlmutter ba...@cs.nuim.ie ... An invalid comparison evaluating to _|_ is arguably more correct, but I personally find the idea of introducing more bottoms rather distasteful. Too late!  NaN is pretty much the _|_ of IEEE Floating Point. That was certainly the intent of

Re: [Haskell-cafe] memory needed for SAX parsing XML

2010-04-22 Thread John Lato
Message: 8 Date: Tue, 20 Apr 2010 12:08:36 +0400 From: Daniil Elovkov daniil.elov...@googlemail.com Subject: Re: [Haskell-cafe] memory needed for SAX parsing XML To: Haskell-Cafe haskell-cafe@haskell.org Message-ID: 4bcd6104.50...@googlemail.com Content-Type: text/plain; charset=ISO-8859-1;

Re: [Haskell-cafe] hamming distance allocation

2010-04-19 Thread John Lato
Subject: Re: [Haskell-cafe] hamming distance allocation Am Montag 19 April 2010 01:03:14 schrieb Arnoldo Muller: Hello all: I want to generate some hamming distance statistics about a set of strings. As explained in another e-mail in this list, I used the following code to call the

Re: [Haskell-cafe] hamming distance allocation

2010-04-19 Thread John Lato
From: Daniel Fischer daniel.is.fisc...@web.de Am Montag 19 April 2010 14:37:33 schrieb John Lato: Is it really necessary to use Strings?  I think a packed type, e.g. Vector or ByteString, would be much more efficient here. Not very much if the strings are fairly short (and the list isn't

Re: [Haskell-cafe] Floyd Warshall performance (again)

2010-04-16 Thread John Lato
From: Mathieu Boespflug mb...@tweag.net Dear haskell-cafe, I implemented the Floyd Warshall algorithm for finding the shortest path in a dense graph in Haskell, but noted the performance was extremely poor compared to C. Even using mutable unboxed arrays it was running about 30 times

Re: [Haskell-cafe] Floyd Warshall performance (again)

2010-04-16 Thread John Lato
On Fri, Apr 16, 2010 at 5:02 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: Am Freitag 16 April 2010 17:41:06 schrieb John Lato: From: Mathieu Boespflug mb...@tweag.net Dear haskell-cafe, I implemented the Floyd Warshall algorithm for finding the shortest path in a dense graph

[Haskell-cafe] Re: building encoding on Windows?

2010-04-01 Thread John Lato
From: Andrew Coppin andrewcop...@btinternet.com A new version is due to be release pretty soon (somewhere begin april). It has Mingw and Msys included, and also some pre-built binaries like cabal and haddock. Plain GHC has included Haddock for a while now. It seems to me that including the

[Haskell-cafe] Re: Data Structures GSoC

2010-03-31 Thread John Lato
From: Roman Leshchinskiy r...@cse.unsw.edu.au On 31/03/2010, at 18:14, Achim Schneider wrote: We have a lot of useful interfaces (e.g. ListLike, Edison), but they don't seem to enjoy wide-spread popularity. Perhaps that's an indication that we need different interfaces? IMO, huge classes

[Haskell-cafe] Re: Do I need to roll my own?

2010-03-31 Thread John Lato
Hi Dave, From: David Leimbach leim...@gmail.com I'm looking at iteratee as a way to replace my erroneous and really inefficient lazy-IO-based backend for an expect like Monad DSL I've been working for about 6 months or so now on and off. The problem is I want something like: expect some

[Haskell-cafe] Re: building encoding on Windows?

2010-03-29 Thread John Lato
Message: 20 Date: Mon, 29 Mar 2010 21:45:49 +0100 From: Subject: Re: [Haskell-cafe] building encoding on Windows? To: haskell-cafe@haskell.org Message-ID: 4bb1117d.5090...@btinternet.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed wagne...@seas.upenn.edu wrote: Whooo,

Re: [Haskell-cafe] Bytestrings and [Char]

2010-03-24 Thread John Lato
Hi Alberto, To some extent this already exists, it's just that nobody uses it. I believe it's the approach taken by the Edison libraries. Also the ListLike package provides the type classes ListLike, StringLike, and a few others. Neither seems to have become very popular despite having

Re: [Haskell-cafe] Bytestrings and [Char]

2010-03-24 Thread John Lato
implementations and compilation flags in a single process would be very useful and would save a lot of manual testing. 2010/3/24 John Lato jwl...@gmail.com Hi Alberto, To some extent this already exists, it's just that nobody uses it.  I believe it's the approach taken by the Edison libraries.  Also

Re: [Haskell-cafe] Iteratee performance

2010-03-19 Thread John Lato
I think this is a bit easier to write with iteratee-HEAD. There are some significant changes from the 0.3 version, and not all the old functions are implemented yet, however the cnt iteratee can be written as: cnt :: Monad m = I.Iteratee S.ByteString m Int cnt = I.liftI (step 0) where step

Re: [Haskell-cafe] Parsec to parse tree structures?

2010-03-15 Thread John Lato
Hi Dave, From: david fries d...@gmx.ch Hello Café Some time ago I wrote a parser for a project of one our customers. The format was proprietary and binary. The data was structured as a tree with tables pointing to sub tables farther in the file. (Well actually there was one or two cases

[Haskell-cafe] Re: First time haskell - parse error!

2010-03-10 Thread John Lato
From: Ketil Malde ke...@malde.org S. Doaitse Swierstra doai...@cs.uu.nl writes:      then (s1 ++ s2 ++ s3 ++ s4) where              s1 = Golds              s2 = show (gold s g)              s3 = , Silvers              s4 = show (silver s g) If you want to keep the definitions local to

[Haskell-cafe] Re: If the local variable can be changed ...

2010-03-10 Thread John Lato
From: zaxis z_a...@163.com So if the local variable can be changed, then we can use loop, etc. same as imperative languages. For example, for (i=0; i100; i++)  where `i` is a local variable in function. In addition to John Millikin's suggestion, you can also do: map f [0..99] where f ::

[Haskell-cafe] Re: Testing and module export lists

2010-02-24 Thread John Lato
From: Magnus Therning mag...@therning.org How do people who like unit testing / property testing deal with export lists? I often find that I do want an export list to reduce clutter in the finished code, but for testing I'd like to expose everything in a module.  Is there a nice way to deal

Re: [Haskell-cafe] Re: Haskell-Cafe Digest, Vol 78, Issue 14

2010-02-12 Thread John Lato
On Fri, Feb 12, 2010 at 10:32 AM, Maciej Piechotka uzytkown...@gmail.com wrote: On Thu, 2010-02-11 at 17:49 -0600, John Lato wrote: On Thu, Feb 11, 2010 at 10:00 AM, Gregory Collins g...@gregorycollins.net wrote: Maciej Piechotka uzytkown...@gmail.com writes: On Tue, 2010-02-09 at 16:41

[Haskell-cafe] data-accessor-template-0.2.1.3 breaks cabal-install with ghc-6.12

2010-02-12 Thread John Lato
Hello, I've recently run across an odd situation. I have a brand new install of GHC-6.12.1 (just did a fresh install of OSX 10.6), and am reinstalling some libraries. I've run into an unusual problem. I'm not sure if this would be considered a cabal bug or not, but I don't think it's a good

Re: [Haskell-cafe] Re: Haskell-Cafe Digest, Vol 78, Issue 14

2010-02-11 Thread John Lato
On Thu, Feb 11, 2010 at 10:00 AM, Gregory Collins g...@gregorycollins.net wrote: Maciej Piechotka uzytkown...@gmail.com writes: On Tue, 2010-02-09 at 16:41 +, John Lato wrote: See http://inmachina.net/~jwlato/haskell/ParsecIteratee.hs for a valid Stream instance using iteratee.  Also

[Haskell-cafe] Re: Haskell-Cafe Digest, Vol 78, Issue 14

2010-02-09 Thread John Lato
Edward's reply was quite good. I'll just try to fill in a few items he didn't address. From: Maciej Piechotka uzytkown...@gmail.com I read a lot about iteratee IO and it seemed very interesting (Unfortunately it lacks tutorial). Especially features like 'no input yet' in network programming

Re: [Haskell-cafe] Iteratee, parsec co.

2010-02-09 Thread John Lato
From: Edward Kmett ekm...@gmail.com 3. Why Seek FileOffset is error message? I'm not quite sure what you're asking here. One of the infelicities of iteratee-0.3 is that it defines a data type: data ErrMsg = Err String | Seek FileOffset deriving (Show, Eq) I

Re: [Haskell-cafe] a beginner question: decorate-op-undecorate

2010-02-08 Thread John Lato
Hi Stephen, From: Stephen Tetley stephen.tet...@gmail.com Hi John I'm not sure about making Binding polymorphic to get Functor, Traversable, Foldable... While I think you're correct that partitionEithers might not be a useful example to draw from in this case, I'd assume that Binding

Re: [Haskell-cafe] safe lazy IO or Iteratee?

2010-02-06 Thread John Lato
, but slower with 100-element chunks. On Fri, Feb 5, 2010 at 08:56, John Lato jwl...@gmail.com wrote: On Fri, Feb 5, 2010 at 4:31 PM, Valery V. Vorotyntsev valery...@gmail.com wrote: John Lato jwl...@gmail.com wrote: Both designs appear to offer similar performance in aggregate, although

Re: [Haskell-cafe] a beginner question: decorate-op-undecorate

2010-02-06 Thread John Lato
From: Aran Donohue aran.dono...@gmail.com Hi Haskell-Cafe, Consider a data type such as data Binding = Binding Var (Either Value [Value]) representing a variable bound either to a fixed value or that has a list of possible values. I'd like to perform an operation on say, the

Re: [Haskell-cafe] safe lazy IO or Iteratee?

2010-02-05 Thread John Lato
On Fri, Feb 5, 2010 at 4:31 PM, Valery V. Vorotyntsev valery...@gmail.com wrote: John Lato jwl...@gmail.com wrote: Both designs appear to offer similar performance in aggregate, although there are differences for particular functions.  I haven't yet had a chance to test the performance

Re: [Haskell-cafe] safe lazy IO or Iteratee?

2010-02-04 Thread John Lato
the proliferation of IO libraries. I know which I approach I think represents the best way forward, but I would be surprised if there was a community consensus at this point. In any case, I'm glad there are a multitude of options and each probably has a place and purpose. Cheers, John Lato

Re: [Haskell-cafe] matrix question

2010-02-03 Thread John Lato
From: Ivan Lazar Miljenovic ivan.miljeno...@gmail.com man manuel.a.cas...@gmail.com writes: http://hackage.haskell.org/package/hmatrix-0.8.1.1 it wraps gls, blas and lapack (so you need to install the libraries). There's also the blas package if you just want blas support. I've been using

Re: [Haskell-cafe] Very imperfect hash function

2010-01-31 Thread John Lato
On Fri, Jan 29, 2010 at 9:26 AM, Hans Aberg hab...@math.su.se wrote: On 29 Jan 2010, at 15:57, John Lato wrote: Are you basically just suggesting to stick everything in an array with the key as an index? You still need to fold the key values onto some interval. Not with a suitably large

Re: [Haskell-cafe] Very imperfect hash function

2010-01-29 Thread John Lato
From: Hans Aberg hab...@math.su.se On 28 Jan 2010, at 20:07, Steve Schafer wrote: The data are currently in a large lookup table. To save space, I'd like to convert that into a sort of hash function: hash :: key - value My question is this: Is there any kind of generic approach that can

Re: [Haskell-cafe] Very imperfect hash function

2010-01-29 Thread John Lato
On Fri, Jan 29, 2010 at 12:46 PM, Hans Aberg hab...@math.su.se wrote: On 29 Jan 2010, at 12:52, John Lato wrote: There are minimal perfect hash functions; there are some libraries mentioned here, though they are not in Haskell code:  http://en.wikipedia.org/wiki/Perfect_hash_function

Re: [Haskell-cafe] hsql won't install due to system.time

2010-01-22 Thread John Lato
Hello, Could this be a global/user install issue? That is, if the old-time package is installed per-user, and you're trying to install a package globally, the user-installed packages all show up as hidden, because they can't be dependencies of a global install. This shows up frequently because

[Haskell-cafe] Re: Is Haskell capable of matching C in string processing performance?

2010-01-22 Thread John Lato
From: Heinrich Apfelmus apfel...@quantentunnel.de Don Stewart wrote: jmillikin: Here's the fastest Haskell version I could come up with. It discards all error handling, validation, and correctness in the name of performance, but still can't get anywhere near C:

Re: [Haskell-cafe] Parsers (Parsec and Iteratee-based Parsers)

2010-01-11 Thread John Lato
with Haskell. I think you should be in contact with John Lato.  Last time we had correspondence he mentioned a hybrid between iteratees and parsec. I don't know if I'd call it a hybrid, however there is a way to embed Parsec parsers (v.3 only) in iteratee. The necessary code is available at: http

[Haskell-cafe] Re: Pattern matching, and bugs

2009-12-19 Thread John Lato
From: Felipe Lessa felipe.le...@gmail.com On Fri, Dec 18, 2009 at 02:13:02PM +, John Lato wrote: So now the program needs a result of some type (String in your example) and gets an undefined, and then immediately crashes with an Exception - undefined error. I think this is the second

[Haskell-cafe] Re: Pattern matching, and bugs

2009-12-18 Thread John Lato
Hello, Date: Fri, 18 Dec 2009 13:04:47 +0100 From: Andr?s Mocs?ry amo...@gmail.com switch 1 =  Unchecked switch 2 =  Checked switch 3 =  Unknown switch x =  Nothing These general ways really avoid this particular crash, but does something real bad to the code in my opinion.

[Haskell-cafe] Re: A new form of newtype

2009-12-09 Thread John Lato
From: Richard O'Keefe o...@cs.otago.ac.nz Subject: Re: [Haskell-cafe] A new form of newtype People are now writing EDSLs using Haskell to generate code for all sorts of interesting things.  What if you want to use Haskell as a host for an EDSL targeted at a 24-bit DSP? *plug* for this

[Haskell-cafe] Re: binding to C libraries on Windoww

2009-12-08 Thread John Lato
From: Andrew Coppin andrewcop...@btinternet.com John Lato wrote: The only workable approach is to have users specify the locations of these files, which unfortunately requires more sophistication than can be expected of most Windows users (and even some Windows developers). Well, I

[Haskell-cafe] Re: binding to C libraries on Windoww

2009-12-07 Thread John Lato
To reply to an earlier point of Andrew's (I can't find the quote now, sorry), one of the biggest difficulties developers face on Windows is the lack of common install locations/practices. Windows software is usually distributed as a binary, which may or may not include header files. These files

[Haskell-cafe] Re: Low Level Audio - Writing bytes to the sound card?

2009-12-04 Thread John Lato
From: M Xyz functionallyharmoni...@yahoo.com if you get it to work As a spoiled Java programmer, this new role as pioneer is a bit intimidating, but I will give it a shot. :) I downloaded the portaudio v19 source and I'm attempting to build it. Apparently I have to register my Visual

[Haskell-cafe] Re: seems like I'm on the wrong track

2009-12-03 Thread John Lato
From: Henning Thielemann lemm...@henning-thielemann.de Michael P Mossey schrieb: Perhaps someone could either (1) help me do what I'm trying to do, or (2) show me a better way. I have a problem that is very state-ful and I keep thinking of it as OO, which is driving me crazy. Haskell is

[Haskell-cafe] Re: Are there standard idioms for lazy, pure, error handling?

2009-11-30 Thread John Lato
From: Bas van Dijk v.dijk@gmail.com On Mon, Nov 30, 2009 at 6:22 AM, John Millikin jmilli...@gmail.com wrote: ...I've considered two possible error handling modes... Regarding parsing, there's a third option: iteratees[1]. See [2] for a motivation and description of iteratees. I think

[Haskell-cafe] advice for dispatch question

2009-11-02 Thread John Lato
Hello, I've been thinking about a problem recently, and would like to know if there are any recommendations for a solution. I have two container-like type classes, defined as follows: import Control.Monad type family ElemOf c :: * type family MonadOf c :: * - * class PureContainer c where

[Haskell-cafe] Re: MTL vs Transformers?

2009-10-13 Thread John Lato
From: Erik de Castro Lopo mle...@mega-nerd.com Well Iteratee built with MTL passes all the tests that shipped with it so I suppose it must be correct. Unfortunately the iteratee tests aren't exhaustive, but if it builds with MTL it should work. I'm more surprised that it built just by

[Haskell-cafe] Re: Documentation (was: ANN: text 0.5, a major revision of the Unicode text library)

2009-10-12 Thread John Lato
From: Derek Elkins derek.a.elk...@gmail.com On Sun, Oct 11, 2009 at 8:55 AM, Iain Barnett iainsp...@gmail.com wrote: On 11 Oct 2009, at 13:58, John Lato wrote: For anyone writing introductions to generic programming, take this as a plea from Haskellers everywhere.  If one of the RWH

[Haskell-cafe] Documentation (was: ANN: text 0.5, a major revision of the Unicode text library)

2009-10-11 Thread John Lato
For anyone writing introductions to generic programming, take this as a plea from Haskellers everywhere. If one of the RWH authors can't understand how to make use of these techniques, what hope do the rest of us have? John Lato P.S. Some might wryly note that I'm the maintainer of a package

[Haskell-cafe] Re: Looking for a new HWN editor

2009-09-08 Thread John Lato
I'd just like to say a big Thank you to Brent for his service as the HWN editor. I appreciate it very much and always look forward to HWN. Thanks for all your work, Brent. Cheers, John Message: 11 Date: Sat, 5 Sep 2009 17:26:08 -0400 From: Brent Yorgey byor...@seas.upenn.edu Subject:

[Haskell-cafe] Re: memoization

2009-09-06 Thread John Lato
Hello, I agree that your answer is elegant, but it's not an efficient algorithm in any language. How about this, keeping the rest of your code the same? import Data.Array.Diff import Data.IArray update :: (Char - [Int]) - DiffArray Int ModP - Char - DiffArray Int ModP update lookup arr c = arr

[Haskell-cafe] Re: memoization

2009-09-06 Thread John Lato
I just discovered that changing DiffArray to a plain Array improves performance of my code by almost a factor of 10. Bitten by DiffArray yet again! John -- this is no good, just change DiffArray to Array. update :: (Char - [Int]) - DiffArray Int ModP - Char - DiffArray Int ModP update lookup

Re: [Haskell-cafe] Re: memoization

2009-09-06 Thread John Lato
On Sun, Sep 6, 2009 at 4:30 PM, Daniel Fischerdaniel.is.fisc...@web.de wrote: Am Sonntag 06 September 2009 13:36:57 schrieb John Lato: I just discovered that changing DiffArray to a plain Array improves performance of my code by almost a factor of 10.  Bitten by DiffArray yet again! That's

[Haskell-cafe] Re: Problem on existential type.

2009-09-05 Thread John Lato
Also, the two definitions for liftGW are exactly equivalent. You have: liftGW (GridWidget label) f = f label liftGW (GridWidget textView) f = f textView The only difference between the two is name to which the data parameter to GridWidget is bound, which doesn't change the meaning at all. You

[Haskell-cafe] Re: quick and dirty file parsing (was: no subject)

2009-08-22 Thread John Lato
in h: f n t but that's probably not what you had in mind. I've found that using unfoldr is simpler than fold if you wish to use HOFs to accomplish this, but neither is as simple as explicit recursion. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe

[Haskell-cafe] Re: How to convert a list to a vector encoding its length in its type?

2009-08-21 Thread John Lato
recently [3], [4]. Cheers, John Lato [1] http://hackage.haskell.org/package/type-level [2] http://www.ict.kth.se/forsyde/files/tutorial/apa.html [3] http://inmachina.net/~jwlato/haskell/iter-audio/src/Sound/Iteratee/Channelized.hs [4] http://inmachina.net/~jwlato/haskell/iter-audio/examples

Re: [Haskell-cafe] containers and maps

2009-08-13 Thread John Lato
On 8/13/09, Jake McArthur jake.mcart...@gmail.com wrote: Jake McArthur wrote: The monoids package offers something similar to this:    mapReduce :: (Generator c, Reducer e m) = (Elem c - e) - c - m If we take (Elem c) to be (item), (e) to be (item'), (c) to be (full), and (m) to be

[Haskell-cafe] Re: unsafeDestructiveAssign?

2009-08-13 Thread John Lato
From: John Meacham j...@repetae.net Subject: Re: [Haskell-cafe] unsafeDestructiveAssign? On Wed, Aug 12, 2009 at 06:48:33PM +0100, John Lato wrote: On Wed, Aug 12, 2009 at 2:39 PM, Derek Elkinsderek.a.elk...@gmail.com wrote: (To Alberto as well.) Unsurprisingly, Lennart

Re: [Haskell-cafe] containers and maps

2009-08-13 Thread John Lato
On Thu, Aug 13, 2009 at 1:51 PM, Jake McArthurjake.mcart...@gmail.com wrote: John Lato wrote: This might work with UVector (I intend to try it this evening); I don't know how well the fusion framework will hold up in class dictionaries. Do report back, as I am curious as well. I have just

[Haskell-cafe] unsafeDestructiveAssign?

2009-08-12 Thread John Lato
Hi Job, I don't think this hypothetical function could exist; you may as well call it notEverSafeOhTheHumanity and be done with it. Since Haskell provides no guarantees about when (if ever) any given function/data will be evaluated, you would need some mechanism to tell the compiler that a data

[Haskell-cafe] containers and maps

2009-08-12 Thread John Lato
automatically. Obviously this isn't so much one container class to rule them all as it is a set of classes that all work together, but as long as it's sensible that's fine with me. Thoughts? John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

[Haskell-cafe] Re: Examples

2009-08-11 Thread John Lato
the question of where to put executables that are Buildable but not Installable. Thoughts? Cheers, John Lato Date: Sun, 9 Aug 2009 21:07:53 -0400 From: John D. Ramsdell ramsde...@gmail.com Subject: Re: [Haskell-cafe] Examples To: Haskell Cafe haskell-cafe@haskell.org Message-ID

[Haskell-cafe] Re: Strange memory usage problem

2009-07-31 Thread John Lato
in the commented-out code, it probably isn't automatically inlined when that code is available. I suspect that the inlining allows GHC to infer some strictness property it otherwise can't. Cheers, John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

[Haskell-cafe] Re: Problems with nested Monads

2009-07-15 Thread John Lato
-like function: join2 :: (Monad n) = n (StateT s n a) - StateT s n a join2 m = StateT (\state - m = flip runStateT state) (I don't know a good name for this function; it's called joinIM in iteratee) Perhaps this would apply to your situation? Cheers, John Lato Message: 18 Date: Fri, 10 Jul

[Haskell-cafe] Re: iteratee enumHandle (and parsing)

2009-07-14 Thread John Lato
tell me what functions you find lacking from iteratee, I'll look into implementing them. I'd rather not re-implement all of Parsec, but the text parsers should be simple enough, as well as some of the combinators. Cheers, John Lato From: Echo Nolan hell...@comcast.net Hi Paolino. What's

[Haskell-cafe] Re: Monad Input/Output and Monad Transformers

2009-07-03 Thread John Lato
probably trying to put together a monad stack to model what you're trying to do too soon, when you'd be better served trying to develop data structures and core functions that describe what you want to do. Of course, without more information this is just a guess. John Lato [1] http

[Haskell-cafe] Re: Strange type error with associated type synonyms

2009-06-04 Thread John Lato
), which means the code would no longer be Haskell98 (which it otherwise is IIRC). Cheers, John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: A problem with par and modules boundaries...

2009-05-22 Thread John Lato
in more detail by going through the Core output. John Lato Message: 23 Date: Thu, 21 May 2009 22:59:51 -0400 From: Mario Bla?evi? mblaze...@stilo.com Subject: [Haskell-cafe] A problem with par and modules boundaries... To: haskell-cafe@haskell.org Message-ID: .1242961...@magma.ca Content-Type

[Haskell-cafe] Re: Data.Binary and little endian encoding

2009-05-15 Thread John Lato
leimy2k: On Thu, May 14, 2009 at 8:46 PM, Don Stewart d...@galois.com wrote: leimy2k: On Thu, May 14, 2009 at 8:40 PM, Don Stewart d...@galois.com wrote:     leimy2k:     I actually need little endian encoding... wondering if anyone else hit     this     with Data.Binary.

[Haskell-cafe] Re: Configuring cabal dependencies at install-time

2009-04-07 Thread John Lato
that with my own packages either; is it a problem? If so, maybe there could be just one extra package, e.g. buster and buster-extras. Is there a better solution I'm missing? John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http

Re: [Haskell-cafe] Re: Configuring cabal dependencies at install-time

2009-04-07 Thread John Lato
'. Others could introduce dependencies on the easier to install library allowing me to shrink the library and I would be able to install in more environments. -Edward Kmett On Tue, Apr 7, 2009 at 9:20 AM, John Dorsey hask...@colquitt.org wrote: John Lato wrote: I think that the proper solution

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-31 Thread John Lato
On Mon, Mar 30, 2009 at 11:03 PM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Sun, 29 Mar 2009, John Lato wrote: On Sat, Mar 28, 2009 at 9:49 PM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Sat, 28 Mar 2009, John Lato wrote: Honestly, me neither, until

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-29 Thread John Lato
On Sat, Mar 28, 2009 at 9:49 PM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Sat, 28 Mar 2009, John Lato wrote: From: Donn Cave d...@avvanta.com I have never felt that I really understood that one. Honestly, me neither, until recently.  I'm only barely starting

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-27 Thread John Lato
On Fri, Mar 27, 2009 at 10:01 AM, Gregory Petrosyan gregory.petrosyan+hask...@gmail.com wrote: Thanks a lot for the answer! On Thu, Mar 26, 2009 at 4:36 PM, John Lato jwl...@gmail.com wrote: Languages with checked exceptions usually use them for two purposes: 1.  Exceptional conditions

[Haskell-cafe] Re: Use unsafePerformIO to catch Exception?

2009-03-27 Thread John Lato
statement, with undefined on [] if necessary? I won't deny that it's extremely useful, though! John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Use unsafePerformIO to catch Exception?

2009-03-27 Thread John Lato
On Fri, Mar 27, 2009 at 9:51 PM, Jason Dusek jason.du...@gmail.com wrote: 2009/03/27 John Lato jwl...@gmail.com: From: Jules Bean ju...@jellybean.co.uk wren ng thornton wrote: The type of head should not be [a] - a + Error, it should be (a:[a]) - a. With the latter type the compiler can

[Haskell-cafe] Re: Exception handling in numeric computations

2009-03-27 Thread John Lato
From: Donn Cave d...@avvanta.com Quoth John Lato jwl...@gmail.com, An exception is caused by some sort of interaction with the run-time system (frequently a hardware issue).  The programmer typically can't check for these in advance, but can only attempt to recover after they've happened

[Haskell-cafe] Re: about Haskell code written to be too smart

2009-03-26 Thread John Lato
. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Exception handling in numeric computations

2009-03-26 Thread John Lato
for the moment. In particular my thoughts from the above paragraph have only recently become clear. Henning T., FYI your constant advocacy has gotten at least one person around to this view. Cheers, John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Re: Exception handling in numeric computations

2009-03-26 Thread John Lato
Message: 15 From: Xiao-Yong Jin xj2...@columbia.edu John Lato jwl...@gmail.com writes: So I have another question.  Is the following function safe and legitimate? safeDiv :: (Exception e, Integral a) =            a - a - Either e a safeDiv x y = unsafePerformIO . try . evaluate $ div x y

[Haskell-cafe] Re: Exception handling in numeric computations

2009-03-25 Thread John Lato
Jake McArthur j...@pikewerks.com writes: Xiao-Yong Jin wrote: | The problem is that there will be many functions using such | a function to invert a matrix, making this inversion | function return Either/Maybe or packing it in a monad is | just a big headache. I disagree. If you try to

[Haskell-cafe] Re: How to increment an Int in Haskell (stack overflow issue)

2009-03-25 Thread John Lato
From: Tim Bauer bauer...@eecs.orst.edu I have a program that is currently blowing out the stack,    Stack space overflow: current size 8388608 bytes.    Use `+RTS -Ksize' to increase it. I am pretty sure I get to the end of the computation that increments various statistic counters

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-04 Thread John Lato
On Tue, Mar 3, 2009 at 1:03 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Mon, 2 Mar 2009, John Lato wrote: While I think that the Iteratee pattern has benefits, I suspect that it can't be combined with regular lazy functions, e.g. of type [a] - [a]. Say I have a chain

[Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-04 Thread John Lato
John A. De Goes schrieb: Elsewhere, laziness can be a real boon, so I don't understand your question, Why have laziness in Haskell at all? As I have written, many libaries process their data lazily (or could be changed to do so without altering their interface) but their interface can

[Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-02 Thread John Lato
are managed strictly and released as soon as possible. I hope this is helpful. Cheers, John Lato Message: 12 Date: Mon, 02 Mar 2009 01:31:02 +0100 From: G??nther Schmidt gue.schm...@web.de Subject: [Haskell-cafe] Re: Left fold enumerator - a real pearl        overlooked? To: haskell-cafe

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-01 Thread John Lato
Hello, I'm not sure that I would call it a general-purpose resource preserving technique. As I understand it, the general concept is a means to handle strict data processing in a functional manner. Any resource preserving that comes from this is actually from the use of strict IO rather than

Re: [Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-03-01 Thread John Lato
Hi Don, Would you please elaborate on what features or capabilities you think are missing from left-fold that would elevate it out of the special purpose category? I think that the conception is so completely different from bytestrings that just saying it's not a bytestring equivalent doesn't

[Haskell-cafe] Re: Left fold enumerator - a real pearl overlooked?

2009-02-28 Thread John Lato
. The results of that research will likely find there way into this library. Sincerely, John Lato Hi all, in the last few months I was looking for haskell database library, eventually settling for HDBC (thanks John btw). Takusen also caught my eye although I even failed installing

[Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-26 Thread John Lato
John Lato jwl...@gmail.com writes: Brandon Allbery wrote: On 2009 Feb 21, at 20:47, Jonathan Cast wrote: On Sat, 2009-02-21 at 07:25 -0700, John A. De Goes wrote: Not showing platform-specific packages by default *might* make package writers more likely to develop cross-platform packages

Re: [Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-26 Thread John Lato
as default search, and also with a +hackage flag. I would also support platform-specific flags if they were simple to implement. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-25 Thread John Lato
of the time. But for many packages, including most packages on hackage, it should be given consideration. Cheers, John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-25 Thread John Lato
On Wed, Feb 25, 2009 at 4:45 PM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On 2009 Feb 25, at 5:23, John Lato wrote: Brandon Allbery wrote: I have to second this; I'm a Unix sysadmin, 98% of the time if I'm writing a program it's for Unix *and* requires POSIX APIxs, and even

Re: [Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-25 Thread John Lato
On Wed, Feb 25, 2009 at 3:49 PM, Jonathan Cast jonathancc...@fastmail.fm wrote: On Wed, 2009-02-25 at 10:23 +, John Lato wrote: 4.  Cross-platform concerns are something that responsible developers need to consider, just like localization and i18n.  I.e., why *shouldn't* you think

[Haskell-cafe] Re: Hoogle and Network.Socket

2009-02-25 Thread John Lato
Achim Schneider wrote: John Lato jwl...@gmail.com wrote: On Wed, Feb 25, 2009 at 4:45 PM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On 2009 Feb 25, at 5:23, John Lato wrote: Brandon Allbery wrote: I have to second this; I'm a Unix sysadmin, 98% of the time if I'm writing

[Haskell-cafe] Re: Google Summer of Code 2009

2009-02-12 Thread John Lato
as to whether this is an appropriate amount of work for GSOC, however simply packaging and cabal-izing Oleg's Iteratee work (or Johan's, or my own) is likely of too small a scope. John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org

Re: [Haskell-cafe] can't figure out a type

2009-02-12 Thread John Lato
families at least. Thanks to everyone who replied; it really helped me clarify my thoughts on this implementation. Cheers, John Lato On Wed, Feb 11, 2009 at 8:28 PM, Job Vranish jvran...@gmail.com wrote: I think what you probably want is something like this: class Chunckable c where cLength :: c

Re: [Haskell-cafe] can't figure out a type

2009-02-12 Thread John Lato
to use the cNull cCons implementation with a rewrite rule for this case, so I think I'm happy now. John On Thu, Feb 12, 2009 at 11:08 PM, John Lato jwl...@gmail.com wrote: Hi Job, thanks for replying. Thanks for explaining this. I never really thought about the implications of kinds on type

[Haskell-cafe] can't figure out a type

2009-02-11 Thread John Lato
basic I'm missing. Could anyone point in the proper direction of how to do this? Can this be expressed with associated types, perhaps? Thanks, John Lato ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell

Re: [Haskell-cafe] can't figure out a type

2009-02-11 Thread John Lato
the window. Do you have a small usage example? On Wed, Feb 11, 2009 at 11:52 AM, John Lato jwl...@gmail.com wrote: Hello, I'm working on some code like the following: class Chunkable c el | c - el where cLength :: c - Int cHead :: c - Maybe el I want to be able to map over

<    1   2   3   4   >