package trampoline

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

The type of a trampoline that doesn't use the stack for recursive computation.

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.