package mnd

  1. Overview
  2. Docs

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

type 'a t
val return : 'a -> 'a t

return x should be a monad which produces x

val map : ('a1 -> 'a2) -> 'a1 t -> 'a2 t

Run a monad and apply a function to the result

val bind : 'a1 t -> ('a1 -> 'a2 t) -> 'a2 t

Sequential composition: First run one monad, then another based on the first result