package clarity

  1. Overview
  2. Docs

Reader monad

include Monad.S2
type (_, _) t
include Monad.Basic2 with type ('p, 'a) t := ('p, 'a) t
include Applicative.Basic2 with type ('p, 'a) t := ('p, 'a) t
include Functor.Basic2 with type ('p, 'a) t := ('p, 'a) t
val bind : ('a -> ('p, 'b) t) -> ('p, 'a) t -> ('p, 'b) t
include Applicative.S2 with type ('p, 'a) t := ('p, 'a) t
include Applicative.Basic2 with type ('p, 'a) t := ('p, 'a) t
include Functor.Basic2 with type ('p, 'a) t := ('p, 'a) t
val pure : 'a -> ('p, 'a) t
val ap : ('p, 'a -> 'b) t -> (unit -> ('p, 'a) t) -> ('p, 'b) t
include Functor.S2 with type ('p, 'a) t := ('p, 'a) t
include Functor.Basic2 with type ('p, 'a) t := ('p, 'a) t
val map : ('a -> 'b) -> ('p, 'a) t -> ('p, 'b) t
val (>|=) : ('p, 'a) t -> ('a -> 'b) -> ('p, 'b) t
val replace : 'a -> ('p, 'b) t -> ('p, 'a) t
val void : ('p, 'a) t -> ('p, unit) t
val ap' : ('p, 'a -> 'b) t -> ('p, 'a) t -> ('p, 'b) t
val (<*>) : ('p, 'a -> 'b) t -> ('p, 'a) t -> ('p, 'b) t
val (<~>) : ('p, 'a -> 'b) t -> (unit -> ('p, 'a) t) -> ('p, 'b) t
val discard_left : ('p, 'a) t -> (unit -> ('p, 'b) t) -> ('p, 'b) t
val discard_right : ('p, 'a) t -> (unit -> ('p, 'b) t) -> ('p, 'a) t
val repeat : int -> ('p, 'a) t -> ('p, 'a list) t
val repeat_ : int -> ('p, 'a) t -> ('p, unit) t
val forever : ('p, 'a) t -> ('p, 'b) t
val (>>=) : ('p, 'a) t -> ('a -> ('p, 'b) t) -> ('p, 'b) t
val join : ('p, ('p, 'a) t) t -> ('p, 'a) t
val mcompose : ('b -> ('p, 'c) t) -> ('a -> ('p, 'b) t) -> 'a -> ('p, 'c) t
val run : ('r, 'a) t -> 'r -> 'a
val reader : ('r -> 'a) -> ('r, 'a) t
val ask : ('r, 'r) t
val local : ('r -> 'r) -> ('r, 'a) t -> ('r, 'a) t
val dimap : ('q -> 'r) -> ('a -> 'b) -> ('r, 'a) t -> ('q, 'b) t
OCaml

Innovation. Community. Security.