package trampoline

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

If you don't want to use trampolines because you're sure that your stack is large enough but you have a functor that depends on the Trampoline module then you can use Not_a_trampoline to use the stack instead of trampolines.

type 'a t

The type of the trampoline, e g the return type of tail-recursive functions.

val execute : 'a t -> 'a

Performs all suspended computations.

val return : 'a -> 'a t

Turns a literal value into a trampoline.

val suspend : (unit -> 'a t) -> 'a t

Delays the computation of a result.

val recursive_call : ('a -> 'b t) -> 'a -> 'b t

Convenience function for recursive calls with one argument.

val bind : 'a t -> ('a -> 'b t) -> 'b t

Accesses values from suspended computations to create new suspended computations.

val map : ('a -> 'b) -> 'a t -> 'b t

Convenience function so you don't have to use bind when you want to have a simple map.

OCaml

Innovation. Community. Security.