[Haskell-cafe] Re: Functional programming for processing oflargeraster images

Simon Peyton-Jones simonpj at microsoft.com
Thu Jun 22 04:22:34 EDT 2006


| 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 = <rhs> in <body>
which will evaluate <rhs> before <body>.

It's an experimental feature, and I'm interested to know how useful, or
otherwise, it turns out to be.

Simon


More information about the Haskell-Cafe mailing list