package monads

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Lifts functions into the monad.

A function that operates on values can be mapped to a function that operates on computations. We provide several liftes for common arities.

val nullary : 'a -> ('a, 'e) T2(M).t

nullary x lifts x (a synonym to return)

val unary : ('a -> 'b) -> ('a, 'e) T2(M).t -> ('b, 'e) T2(M).t

unary f lifts f

val binary : ('a -> 'b -> 'c) -> ('a, 'e) T2(M).t -> ('b, 'e) T2(M).t -> ('c, 'e) T2(M).t

binary f lifts f

val ternary : ('a -> 'b -> 'c -> 'd) -> ('a, 'e) T2(M).t -> ('b, 'e) T2(M).t -> ('c, 'e) T2(M).t -> ('d, 'e) T2(M).t

ternary f lifts f

val quaternary : ('a -> 'b -> 'c -> 'd -> 'e) -> ('a, 's) T2(M).t -> ('b, 's) T2(M).t -> ('c, 's) T2(M).t -> ('d, 's) T2(M).t -> ('e, 's) T2(M).t

quaternary f lifts f

val quinary : ('a -> 'b -> 'c -> 'd -> 'e -> 'f) -> ('a, 's) T2(M).t -> ('b, 's) T2(M).t -> ('c, 's) T2(M).t -> ('d, 's) T2(M).t -> ('e, 's) T2(M).t -> ('f, 's) T2(M).t

quinary f lifts f