package orsetto

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

Use module M = Create(B) to create a module that implements all the conventional interfaces of a monad.

Parameters

module B : Basis

Signature

Module inclusions from Cf_monad_core and Cf_seqmonad.

include Core.Unary.Profile with type 'r t := 'r B.t
val return : 'r -> 'r B.t

Use return a to apply the binding to a.

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

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

val map : 'a B.t -> f:('a -> 'b) -> 'b B.t

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

module Infix : Cf_monad_core.Unary.Infix with type 'r t := 'r B.t

Open Infix to include the infix monad operators.

val disregard : 'r B.t -> unit B.t

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

include Cf_seqmonad.Functor.Unary with type 'r t := 'r B.t
val collect : 'r B.t Seq.t -> (int * 'r list) B.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 : unit B.t Seq.t -> unit B.t

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