The encapsulated environment.
The type held by the env comonad.
get the underlying comonad.
Unwrap the env computation.
Retrieves the environment.
val asks : (env -> 'b) -> 'a t -> 'bRetrieves the environment and apply a function.
val local : (env -> env) -> 'a t -> 'a tModifies the environment using the specified function.
Perform local with an other environment.
Comonad
Type
Type
Functions
val duplicate : 'a t -> 'a t tval map : ('a -> 'b) -> 'a t -> 'b tMapping over t from 'a to 'b.
val extend : ('a t -> 'b) -> 'a t -> 'b tExtract a 'a from t. Dual of return.
val compose_left_to_right : ('a t -> 'b) -> ('b t -> 'c) -> 'a t -> 'cComposing monadic functions using Co-Kleisli Arrow (from left to right).
val lift : ('a -> 'b) -> 'a t -> 'b tMapping over t from 'a to 'b.
val lift2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c tLift a binary function that acts on arbitrary values into a function that acts t values.
val lift3 : ('a -> 'b -> 'c -> 'd) -> 'a t -> 'b t -> 'c t -> 'd tLift a ternary function that acts on arbitrary values into a function that acts t values.
val compose_right_to_left : ('b t -> 'c) -> ('a t -> 'b) -> 'a t -> 'cComposing co-monadic functions using Co-Kleisli Arrow (from right to left).
val replace : 'a -> 'b t -> 'a tCreate a new t, replacing all values of the given functor by given a value of 'a.
val void : 'a t -> unit tCreate a new t, replacing all values in the given functor by unit.
Infix operators
val (=>>) : 'a t -> ('a t -> 'b) -> 'b tInfix flipped version of CORE.extend.
val (<<=) : ('a t -> 'b) -> 'a t -> 'b tInfix version of CORE.extend.
val (=>=) : ('a t -> 'b) -> ('b t -> 'c) -> 'a t -> 'cInfix version of CORE.compose_left_to_right.
val (=<=) : ('b t -> 'c) -> ('a t -> 'b) -> 'a t -> 'cInfix version of OPERATION.compose_right_to_left.
val (<@@>) : 'a t -> ('a -> 'b) t -> 'b tApplicative functor of ('a -> 'b) t over ('a, 'index) t to ('b, 'index) t.
val (<@>) : ('a -> 'b) t -> 'a t -> 'b tApplicative functor of ('a -> 'b) t over ('a, 'index) t to ('b, 'index) t.
val (@>) : unit t -> 'b t -> 'b tDiscard the value of the first argument.
val (<@) : 'a t -> unit t -> 'a tDiscard the value of the second argument.
val (<$>) : ('a -> 'b) -> 'a t -> 'b tInfix version of CORE.map.
val (<&>) : 'a t -> ('a -> 'b) -> 'b tFlipped and infix version of CORE.map.
val (<$) : 'a -> 'b t -> 'a tInfix version of OPERATION.replace.
val ($>) : 'a t -> 'b -> 'b tFlipped and infix version of OPERATION.replace.
Syntax
val let@ : 'a t -> ('a t -> 'b) -> 'b tSyntactic shortcuts for version of CORE.extend:
let@ x = e in f is equals to extend f e.