Module
Control.Monad.Trampoline
- Package
- purescript-free
- Repository
- purescript/purescript-free
A trampoline monad, which can be used at the bottom of a monad transformer stack to avoid stack overflows in large monadic computations.
#Trampoline Source
type Trampoline = Free (Function Unit)
The Trampoline
monad
A computation of type Trampoline a
consists of zero or more lazy
suspensions before a value is returned.
#done Source
done :: forall a. a -> Trampoline a
Return a value immediately
#delay Source
delay :: forall a. (Unit -> a) -> Trampoline a
Use the Trampoline
monad to represent the delayed evaluation of a value.
#runTrampoline Source
runTrampoline :: forall a. Trampoline a -> a
Run a computation in the Trampoline
monad.