package orsetto

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

A module type that defines the core monad functions.

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

The abstract type of monad with three parameters, two phantom types and a return type.

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.

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

Use product a b to return the monoidal product of a and b.

module Affix : Affix with type ('p, 'q, 'r) t := ('p, 'q, 'r) t

Open Affix to include the affix 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.

module Infix = Affix

Deprecated module alias.