Poor Man's Time Machine: Lazy Evaluation in JavaScript and Haskell
SMRTR summary
Lazy evaluation lets you solve the classic 'replace all elements with the minimum in one pass' puzzle without two separate traversals. In JavaScript, this means wrapping an unevaluated reference in a closure to defer lookup until the minimum is known. Haskell handles this natively via thunks and call-by-need evaluation, making the 'knot-tying' trick cleaner and returning actual values instead of functions.
SMRTR provides this summary for quick context. The original article belongs to Reddit.
Read the original article