package prbnmcn-dagger

  1. Overview
  2. Docs
include Intf.Core with type 'a t = RNG.t -> 'a
type 'a t = RNG.t -> 'a

'a t is the type of computations 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-ary 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.

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

Innovation. Community. Security.