package travesty

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

Generic_runners contains generic versions of the 'runner' functions common to all state monad signatures.

include Generic_types
type ('a, 's) t

t is the type of the state monad.

type 'a final

final is the type of returned results. In transformers, this becomes 'a Inner.t; otherwise, it becomes just 'a.

type 's state

state is the type used to represent the state outside of its monad. In S, 's state becomes x for some type x; in S2, 's state becomes 's.

val run' : ('a, 's) t -> 's state -> ('s state * 'a) final

run' unfolds a t into a function from context to final state and result.

val run : ('a, 's) t -> 's state -> 'a final

run unfolds a t into a function from context to final result. To get the final context, use run' or call peek at the end of the computation.