package prbnmcn-dagger

  1. Overview
  2. Docs
type 'a t = 'a

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

type 'a res = 'a

'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 map2 : 'a t -> 'b t -> ('a -> 'b -> 'c) -> 'c t

Applicative structure

val map_array : 'a t array -> ('a array -> 'b) -> 'b t

N-array applicative structure

val if_ : bool t -> (bool -> 'a t) -> 'a t

If-then-else, mostly useful for monads featuring incremental computation. Allows to efficiently bind on a boolean computation.

val run : 'a t -> 'a res

Running a monadic computation

module Infix : Intf.Infix with type 'a t := 'a t
OCaml

Innovation. Community. Security.