Re: [Haskell-cafe] Some random newbie questions

2005-01-09 Thread Jorge Adriano Aires
> (+) is > usually strict on both arguments (although in principle it does not > have to be true because of overloading, which implies that a compiler > can only optimize particular specializations of sum, not generic sum). Since you mention it, there was some talk about this in the #haskell chann

Re: [Haskell-cafe] Some random newbie questions

2005-01-09 Thread Jorge Adriano Aires
On Sunday 09 January 2005 21:30, Marcin 'Qrczak' Kowalczyk wrote: > Jorge Adriano Aires <[EMAIL PROTECTED]> writes: > >> No, it would work with strict foldl too. In fact in the absence > >> of optimization it would work better (uses less time and space). > >> The optimization required is inlining a

Re: [Haskell-cafe] Some random newbie questions

2005-01-09 Thread Marcin 'Qrczak' Kowalczyk
Jorge Adriano Aires <[EMAIL PROTECTED]> writes: >> No, it would work with strict foldl too. In fact in the absence >> of optimization it would work better (uses less time and space). >> The optimization required is inlining and strictness analysis. > > Is this also true if your just going to use t

Re: [Haskell-cafe] Some random newbie questions

2005-01-09 Thread Jorge Adriano Aires
> No, it would work with strict foldl too. In fact in the absence > of optimization it would work better (uses less time and space). > The optimization required is inlining and strictness analysis. Is this also true if your just going to use the first few elements after reversing it? > A functi

Re: [Haskell-cafe] Some random newbie questions

2005-01-09 Thread Jorge Adriano Aires
> On Friday 07 January 2005 12:03, Ketil Malde wrote: > > Naive use of foldl.  I tend to think the default foldl should be > > strict (ie. replaced by foldl') -- are there important cases where it > > needs to be lazy? > > Hi, > One simple example would be, > > reverse = foldl (flip (:)) [] A bet

Re: [Haskell-cafe] Some random newbie questions

2005-01-09 Thread Marcin 'Qrczak' Kowalczyk
Jorge Adriano Aires <[EMAIL PROTECTED]> writes: >> Naive use of foldl.  I tend to think the default foldl should be >> strict (ie. replaced by foldl') -- are there important cases where it >> needs to be lazy? > > Hi, > One simple example would be, >> reverse = foldl (flip (:)) [] No, it would w

Re: [Haskell-cafe] Some random newbie questions

2005-01-09 Thread Jorge Adriano Aires
On Friday 07 January 2005 12:03, Ketil Malde wrote: > Naive use of foldl.  I tend to think the default foldl should be > strict (ie. replaced by foldl') -- are there important cases where it > needs to be lazy? Hi, One simple example would be, > reverse = foldl (flip (:)) [] J.A. ___

Re: [Haskell-cafe] Some random newbie questions

2005-01-09 Thread O . Chitil
>> I'm constantly surprised hearing from so many people about their space >> problems. I cannot remember having space problems with my programs. I >> don't know what everybody else is doing wrong :-) > > At least two common cases. > > Extracting compact data structures from large files. The conte

Re: [Haskell-cafe] Some random newbie questions

2005-01-08 Thread Benjamin Pierce
Many thanks to everyone for the very helpful answers to my queries! - Benjamin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Preventing space leaks without seq (was: Re: [Haskell-cafe] Some random newbie questions)

2005-01-07 Thread Henk-Jan van Tuyl
L.S., Olaf <[EMAIL PROTECTED]> wrote: I'm constantly surprised hearing from so many people about their space problems. I cannot remember having space problems with my programs. I don't know what everybody else is doing wrong I do disagree with people recommending strictness annotations (seq etc).

Re: [Haskell-cafe] Some random newbie questions

2005-01-07 Thread Ross Paterson
On Fri, Jan 07, 2005 at 08:49:32AM -0500, Paul Hudak wrote: > I taught our FP class this fall using Hugs, but in the end wish that I > had used GHC. There are lots of little reasons for this, but a big one > was a problem with unpredictable space utilization. I don't have the > examples at my

Re: [Haskell-cafe] Some random newbie questions

2005-01-07 Thread Paul Hudak
Benjamin Pierce wrote: OK, I'm taking the plunge and using Haskell in a course I'm teaching this semester. To get ready, I've been doing quite a bit of Haskell programming myself, and this has raised a few questions... * What are the relative advantages of Hugs and GHC, beyond the obvious (Hugs

Re: [Haskell-cafe] Some random newbie questions

2005-01-07 Thread Ketil Malde
[EMAIL PROTECTED] writes: > I'm constantly surprised hearing from so many people about their space > problems. I cannot remember having space problems with my programs. I > don't know what everybody else is doing wrong :-) At least two common cases. Extracting compact data structures from large

Re: [Haskell-cafe] Some random newbie questions

2005-01-07 Thread O . Chitil
> * What are the relative advantages of Hugs and GHC, beyond the obvious > (Hugs > is smaller and easier for people not named Simon to modify, while GHC is > a > real compiler and has the most up-to-date hacks to the type checker)? > Do > people generally use one or the other for everything,

RE: [Haskell-cafe] Some random newbie questions

2005-01-07 Thread Simon Peyton-Jones
| * As far as I can determine, there is no way to check pattern matches for | exhaustiveness. Coming from OCaml, this feels like losing a significant | safety net! How do people program so as not to be getting dynamic match | failures all the time? GHC has -fwarn-incomplete-patterns and -f

Re: [Haskell-cafe] Some random newbie questions

2005-01-06 Thread ross
On Thu, Jan 06, 2005 at 09:11:13AM -0800, Benjamin Pierce wrote: > * I wrote a little program for generating Sierpinkski Carpets, and was > astonished to find that it runs out of heap under Hugs (with standard > settings -- raising the heap size with -h leads to a happier result). This is an a

Re: [Haskell-cafe] Some random newbie questions

2005-01-06 Thread Jacob Nelson
On Thu, 6 Jan 2005, Greg Buchholz wrote: > As one data point, I don't think "SOEGraphics" works with GHC or > recent versions of Hugs (http://www.haskell.org/soe/graphics.htm). I had trouble with this recently, and a friend of a friend suggested I use the latest GHC from CVS, and import Gra

Re: [Haskell-cafe] Some random newbie questions

2005-01-06 Thread Greg Buchholz
Benjamin Pierce wrote: > * What are the relative advantages of Hugs and GHC, beyond the obvious (Hugs > is smaller and easier for people not named Simon to modify, while GHC is a > real compiler and has the most up-to-date hacks to the type checker)? Do > people generally use one or the othe

Re: [Haskell-cafe] Some random newbie questions

2005-01-06 Thread Philippa Cowderoy
On Thu, 6 Jan 2005, Benjamin Pierce wrote: * As far as I can determine, there is no way to check pattern matches for exhaustiveness. Coming from OCaml, this feels like losing a significant safety net! How do people program so as not to be getting dynamic match failures all the time? Where not

Re: [Haskell-cafe] Some random newbie questions

2005-01-06 Thread Shae Matijs Erisson
Benjamin Pierce <[EMAIL PROTECTED]> writes: > * What are the relative advantages of Hugs and GHC, beyond the obvious (Hugs > is smaller and easier for people not named Simon to modify, while GHC is a > real compiler and has the most up-to-date hacks to the type checker)? Do > people general

Re: [Haskell-cafe] Some random newbie questions

2005-01-06 Thread Henning Thielemann
On Thu, 6 Jan 2005, Benjamin Pierce wrote: > * What are the relative advantages of Hugs and GHC, beyond the obvious (Hugs > is smaller and easier for people not named Simon to modify, while GHC is a > real compiler and has the most up-to-date hacks to the type checker)? Do > people general

Re: [Haskell-cafe] Some random newbie questions

2005-01-06 Thread Henning Thielemann
On Thu, 6 Jan 2005, David Roundy wrote: > On Thu, Jan 06, 2005 at 09:11:13AM -0800, Benjamin Pierce wrote: > > * As far as I can determine, there is no way to check pattern matches for > > exhaustiveness. Coming from OCaml, this feels like losing a significant > > safety net! How do people

Re: [Haskell-cafe] Some random newbie questions

2005-01-06 Thread David Roundy
On Thu, Jan 06, 2005 at 09:11:13AM -0800, Benjamin Pierce wrote: > * As far as I can determine, there is no way to check pattern matches for > exhaustiveness. Coming from OCaml, this feels like losing a significant > safety net! How do people program so as not to be getting dynamic match >