[Haskell-cafe] Re: CAF's in Haskell

Peter Verswyvelen bf3 at telenet.be
Wed Dec 26 13:30:38 EST 2007


Well I certainly hope the standard defines that both fred and bob will only
be evaluated once, because my programs depend on that :) 

Peter

Neil wrote:
> fred = 2 + 2
> bob = fred + fred
> In a Haskell implementation fred would be evaluated once to 4, then
> used twice. The 2+2 would only happen once (ignore defaulting and
> overloaded numerics for now).
> Is this sharing mandated by the standard? (I don't think so) Is there
> some paper that describes why this is desirable, and gives any detail?
> Do all Haskell compilers support the sharing?



More information about the Haskell-Cafe mailing list