package prbnmcn-basic-structures

  1. Overview
  2. Docs

Module type of a plain monad

type 'a t

'a t is the type of computations of type 'a

type 'a res

'a res is the outcome of running a computation of type 'a

val return : 'a -> 'a t

return x injects a value x as a computation

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

Monadic bind

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

Functorial map

val run : 'a t -> 'a res

Running a monadic computation

module Infix : sig ... end

Innovation. Community. Security.