package prbnmcn-dagger

  1. Overview
  2. Docs

Module Internal.Identity_monadSource

Sourcemodule M : Intf.Core with type 'a t = 'a
include module type of struct include M end
Sourcetype 'a t = 'a

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

Sourceval return : 'a -> 'a t

return x injects a value x as a computation

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

Monadic bind

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

Functorial map

Sourceval map2 : 'a t -> 'b t -> ('a -> 'b -> 'c) -> 'c t

Applicative structure

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

N-ary applicative structure

Sourceval 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.

Sourcemodule Infix = M.Infix
OCaml

Innovation. Community. Security.