package orsetto

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type +'r t

The abstract type of monad with a parameter for its return type.

val return : 'r -> 'r t

Define return a to apply a to the bound function.

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

Define bind m f to apply the value returned by m to the function f to obtain the result monad.

val mapping : [ `Default | `Special of 'a t -> f:('a -> 'b) -> 'b t ]

Define mapping to select the `map` operator to be either the default fun a -> return (f a) or as some other special map function.

val product : [ `Default | `Special of 'a t -> 'b t -> ('a * 'b) t ]

Define product to select the `product` operator to be either fun a b -> bind a (fun r1 -> bind b (fun r2 -> return (r1, r2))) or some other special function.

OCaml

Innovation. Community. Security.