package olmi

  1. Overview
  2. Docs

Parameters

module P : OlmiInterfaces.PLUS with type 'a t = 'a M.t

Signature

include OlmiInterfaces.INTERFACE with type 'a t = 'a M.t
include OlmiInterfaces.BASIC_INTERFACE with type 'a t = 'a M.t
include OlmiInterfaces.COMMON with type 'a t = 'a M.t
type 'a t = 'a M.t
val return : 'a -> 'a t

Place a value in a minimal monadic context

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

The join function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level.

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

Sequentially compose two actions, passing any value produced by the first as an argument to the second.

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

Sequential application

include OlmiInterfaces.INFIX with type 'a t := 'a t
val (<*>) : ('a -> 'b) t -> 'a t -> 'b t

Sequential application.

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

infix alias of fmap

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

Replace all locations in the input with the same value.

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

Sequence actions, discarding the value of the first argument.

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

Sequence actions, discarding the value of the second argument.

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

A variant of <*> with the arguments reversed.

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

Sequentially compose two actions, passing any value produced by the first as an argument to the second.

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

infix alias of fmap

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

Right-to-left Kleisli composition of monads. (>=>), with the arguments flipped

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

Left-to-right Kleisli composition of monads.

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

Flipped version of >>=

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

Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.

include OlmiInterfaces.LIFT with type 'a t := 'a t
val liftM : ('a -> 'b) -> 'a t -> 'b t

Promote a function to a monad.

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

Promote a function to a monad, scanning the monadic arguments from left to right

val liftM3 : ('a -> 'b -> 'c -> 'd) -> 'a t -> 'b t -> 'c t -> 'd t

Promote a function to a monad, scanning the monadic arguments from left to right

val liftM4 : ('a -> 'b -> 'c -> 'd -> 'e) -> 'a t -> 'b t -> 'c t -> 'd t -> 'e t

Promote a function to a monad, scanning the monadic arguments from left to right

val liftM5 : ('a -> 'b -> 'c -> 'd -> 'e -> 'f) -> 'a t -> 'b t -> 'c t -> 'd t -> 'e t -> 'f t

Promote a function to a monad, scanning the monadic arguments from left to right

val void : 'a t -> unit t

void value discards or ignores the result of evaluation, such as the return value of an IO action.

include OlmiInterfaces.PLUS with type 'a t := 'a t
val mempty : 'a t

Represent the neutral element

val mplus : 'a t -> 'a t -> 'a t

Monoïd combination

val (<+>) : 'a t -> 'a t -> 'a t

Infix operator for mplus

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

list >>= keep_if predicat returns a list containing all values who's respecting the gived predicat.

OCaml

Innovation. Community. Security.