Thunks
← Back to Lazy Evaluation
A thunk is a deferred computation wrapped in a zero-argument function. Instead of evaluating an expression immediately, the computation is stored as a thunk and only evaluated when the result is needed. Once evaluated, the result is typically cached (memoized).