Function makeTrampolineThunk

Creates a trampoline thunk object.

A "thunk" is a deferred computation — instead of performing a recursive call immediately, it wraps the next step of the computation in a function. This allows recursive processes to be executed iteratively, preventing stack overflows.

  • Type Parameters

    • T

      The type of the final computation result.

    Parameters

    • computation: (() => Trampoline<T>)

      A function that, when executed, returns the next trampoline step.

        • (): Trampoline<T>
        • Returns Trampoline<T>

    Returns TrampolineThunk<T>

    A TrampolineThunk object containing the deferred computation.