Re: [Haskell-cafe] Re: Functional programming for processing oflargeraster images
--- Matthias Fischmann <[EMAIL PROTECTED] wrote: > On Thu, Jun 22, 2006 at 09:22:34AM +0100, Simon Peyton-Jones wrote: > > To: Brian Hulley <[EMAIL PROTECTED]>, Joel Reymont <[EMAIL PROTECTED]> > > Cc: haskell-cafe@haskell.org > > From: Simon Peyton-Jones <[EMAIL PROTECTED]> > > Date: Thu, 22 Jun 2006 09:22:34 +0100 > > Subject: RE: [Haskell-cafe] Re: Functional programming for processing > > oflargeraster images > > > > http://haskell.galois.com/cgi-bin/haskell-prime/trac.cgi/wiki/BangPatterns > > > > Bang patterns make it much more convenient to write a strict function. > > E.g > > f (x, !y) = ... > > is strict both in the pair (of course) but also in the second component > > of the pair, y. > > i am ecstatic to hear that :). Well, you shouldn't be too enthusiastic, but rather follow the above link ... > if it really means that 'y' will be fully evaluated (not top level > normal form, but whatsthenameforthis, in the way ocaml evaluates > expressions), it's something i have been missing so much that i was > thinking of switching back to a strict language again. ... to find out that that's exactly not what bang patterns will do for you. They are compiled into uses of seq, which means evaluation to weak head normal form. Ciao, Janis. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Functional programming for processing oflargeraster images
hi, 2006/6/22, Simon Peyton-Jones <[EMAIL PROTECTED]>: [real big snip :)] I think you're one of the best person to advocate pros and cons of laziness/strictness. So i'm a bit surprised to see this : It's an experimental feature, and I'm interested to know how useful, or otherwise, it turns out to be. Coudn't you predict it (both in terms of the programmers and compiler writers) ? thanks, vo minh thu ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Functional programming for processing oflargeraster images
On Thu, Jun 22, 2006 at 09:22:34AM +0100, Simon Peyton-Jones wrote: > To: Brian Hulley <[EMAIL PROTECTED]>, Joel Reymont <[EMAIL PROTECTED]> > Cc: haskell-cafe@haskell.org > From: Simon Peyton-Jones <[EMAIL PROTECTED]> > Date: Thu, 22 Jun 2006 09:22:34 +0100 > Subject: RE: [Haskell-cafe] Re: Functional programming for processing > oflargeraster images > > http://haskell.galois.com/cgi-bin/haskell-prime/trac.cgi/wiki/BangPatterns > > Bang patterns make it much more convenient to write a strict function. > E.g > f (x, !y) = ... > is strict both in the pair (of course) but also in the second component > of the pair, y. i am ecstatic to hear that :). if it really means that 'y' will be fully evaluated (not top level normal form, but whatsthenameforthis, in the way ocaml evaluates expressions), it's something i have been missing so much that i was thinking of switching back to a strict language again. will upgrade as soon as i can, thanks! m. signature.asc Description: Digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Re: Functional programming for processing oflargeraster images
| Everything else about Haskell is so great and well thought out (eg type | classes, no side effects, higher rank polymorphism, existentials) it seems a | pity to throw all this away just because of one unfortunate feature I thought it might be worth mentioning that GHC (well, the HEAD, which will become 6.6) supports "bang patterns". See http://haskell.galois.com/cgi-bin/haskell-prime/trac.cgi/wiki/BangPatter ns Bang patterns make it much more convenient to write a strict function. E.g f (x, !y) = ... is strict both in the pair (of course) but also in the second component of the pair, y. You can also use them in lets let !x = in which will evaluate before . It's an experimental feature, and I'm interested to know how useful, or otherwise, it turns out to be. Simon ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe