package orsetto

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

The signature of modules produced by the Create(B: Basis) functor.

type ('p, 'q, +'r) t

The abstract type of a monad.

Module inclusions from Cf_monad_core and Cf_seqmonad.

include Core.Trinary.Profile with type ('p, 'q, 'r) t := ('p, 'q, 'r) t
val return : 'r -> ('p, 'q, 'r) t

Use return a to apply the binding to a.

val bind : ('p, 'q, 'a) t -> ('a -> ('p, 'q, 'b) t) -> ('p, 'q, 'b) t

Use bind m f to bind f to the value returned by m.

val map : ('p, 'q, 'a) t -> f:('a -> 'b) -> ('p, 'q, 'b) t

Use map m f to return the result of applying f to the value returned by m.

module Infix : Cf_monad_core.Trinary.Infix with type ('p, 'q, 'r) t := ('p, 'q, 'r) t

Open Infix to include the infix monad operators.

val disregard : ('p, 'q, 'r) t -> ('p, 'q, unit) t

Use disregard m to ignore the value returned by m and apply the unit value to the bound function.

include Cf_seqmonad.Functor.Trinary with type ('p, 'q, 'r) t := ('p, 'q, 'r) t
val collect : ('p, 'q, 'r) t Seq.t -> ('p, 'q, int * 'r list) t

Use collect s to bind in sequence every monad value in the finite sequence s and collect all the returned values. Returns (n, s) where n is the number of values collected and s is the list of values in reverse order, i.e. from last collected to first collected. Never returns and exhausts all memory if s never terminates.

val serial : ('p, 'q, unit) t Seq.t -> ('p, 'q, unit) t

Use serial s to bind in sequence every monad value in the sequence s.