
15 Mar
2015
15 Mar
'15
5:44 p.m.
On Sun, Mar 15, 2015, at 09:17 AM, Simon Kitching wrote:
And AIUI the Haskell compiler/runtime can postpone evaluation of any function (laziness), or reorder function calls whever it thinks this good.
It's not that it "can" but that it must. Haskell's evaluation strategy is a part of the language specification. Consider this expression: let f = 1 : f in take 5 f You can paste this into ghci and feel confident that it's going to terminate. You're not at the whim of the runtime. I think you may find these articles interesting: https://wiki.haskell.org/Lazy_evaluation https://wiki.haskell.org/Non-strict_semantics -Karl