3 ms·
Be careful lest thou misunderstand the GHC runtime, which is fairly subtle. In Haskell, the semantics are unchanged if the runtime evaluates a particular thunk
by klodolph 16y ago
Be careful lest thou misunderstand the GHC runtime, which is fairly subtle.
In Haskell, the semantics are unchanged if the runtime evaluates a particular thunk multiple times. Haskell is fairly unique in this regard. For exactly this reason, Haskell threads do not need to synchronize when evaluating thunks in multicore environments. Synchronization has a cost, and that cost can exceed the cost of duplicate evaluation.
It's a trade off.