[Haskell-cafe] GHC predictability
bos at serpentine.com
Tue May 13 15:40:05 EDT 2008
Darrin Thompson wrote:
> These "tricks" going into Real World Haskell?
Some will, yes.
For example, the natural and naive way to write Andrew's "mean" function
doesn't involve tuples at all: simply tail recurse with two accumulator
parameters, and compute the mean at the end. GHC's strictness analyser
does the right thing with this, so there's no need for seq, $!, or the
like. It's about 3 lines of code.
More information about the Haskell-Cafe