Thunks
A thunk is a small routine that encapsulates a computation to be performed later. In programming, a thunk is typically a parameterless function or closure that delays evaluation of an expression until it is explicitly invoked.
Thunks serve several roles: they implement lazy evaluation, control evaluation order, or adapt calling conventions. In
In practical programming, thunks appear in many forms. In JavaScript, a thunk is a function that wraps
Example: a thunk can be defined as function thunk() { return expensiveComputation(); }. Calling thunk() executes the computation
The term likely originated in early compiler literature, referring to a small piece of code that defers