[Haskell-beginners] Evaluation order semantics..
Keshav Kini
keshav.kini at gmail.com
Tue Sep 24 00:29:48 CEST 2013
Mike Meyer <mike at fpcomplete.com> writes:
> The language specification doesn't define the evaluation strategy
> because it doesn't matter. At least, it doesn't matter in pure code.
> You'll get the same answer no matter what order expressions are
> evaluated in, so long as they are evaluated by the time they are
> needed.
Is non-termination included in "pure code"? If so, then different
evaluation strategies can indeed affect whether or not an expression can
be evaluated "by the time it is needed", or even at all.
let foo = foo in const () foo
... is an example of an expression that terminates with a sufficiently
lazy evaluation strategy but doesn't terminate given a sufficiently
eager evaluation strategy.
Or did I misunderstand what you meant?
-Keshav
More information about the Beginners
mailing list