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 ('m, +'r) t

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

val return : 'r -> ('m, 'r) t

Use return a to apply the binding to a.

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

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

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

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

module Infix : Infix with type ('m, 'r) t := ('m, 'r) t

Open Infix to include the infix monad operators.

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

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