mgree/trapmoline

Trampolining is a method for cooperative, stackless computation. The trampolining method was first used to implement support for continuations and other control flow in Lisp-like languages. Here, we use the trampolining idiom to cooperatively multitask: long running code can be either run directly with a stepper or via a "fuel" monad.
There are two examples: a simple example of a fueled computation and an interpreter for the simply typed lambda calculus.