package mnd

  1. Overview
  2. Docs

Binary monads

A binary monad interprets a type ('a, 'b) t as computation of values of type 'a. Note that combining such monads requires the second type 'b to be equal in all of them.

module type MONAD2_DEF = sig ... end
module type MONAD2 = sig ... end
module Make2 (M : MONAD2_DEF) : MONAD2 with type ('a, 'b) t = ('a, 'b) M.t

Unary monads

A unary monad interprets a type 'a t as computation of values of type 'a.

module type MONAD_DEF = sig ... end

The fundamental functions defining a monad, i.e. what you need to implement in order to instantiate a monad with Make

module type MONAD = sig ... end

The monad interface with let*-syntax, common operators and functions. These are the elements you get when instantiating a monad with Make.

module Make (M : MONAD_DEF) : MONAD with type 'a t = 'a M.t

Functor to instantiate the MONAD interface for custom monads by providing a MONAD_DEF.

module Instances : sig ... end