package alba

  1. Overview
  2. Docs
Alba compiler

Install

Dune Dependency

Authors

Maintainers

Sources

0.4.2.tar.gz
sha256=203ee151ce793a977b2d3e66f8b3a0cd7a82cc7f15550c63d88cb30c71eb5f95
md5=64367c393f80ca784f88d07155da4fb0

doc/alba.fmlib/Fmlib/Monad/Of_sig_with_map/index.html

Module Monad.Of_sig_with_map

Parameters

module M : SIG_WITH_MAP

Signature

type 'a t = 'a M.t

The type of the monad containing values of type 'a

val return : 'a -> 'a t

return a makes a monadic container containing the value a.

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

m >>= f extracts the value a from the monadic container m and returns f a.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

f >=> g composition of the two monadic functions f and g.

f >=> g is equivalent to fun a -> f a >>= g.

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

map f m maps the values in the monadic container m with the function f.

val join : 'a t t -> 'a t

Remove one level of container. join m is equivalent to mm >>= fun m -> m.

val (<*>) : ('a -> 'b) t -> 'a t -> 'b t

f <*> m applies the function contained in f to the content of the monadic container m and injects the result into a new monadic container.

OCaml

Innovation. Community. Security.