Module type Reader.CORE

Operation of Reader monad parametrized over an inner monad and an environment.

type env

The encapsulated state.

type 'a monad

The inner monad.

type 'a t = env -> 'a monad

The type held by the reader monad.

val upper : 'a monad -> 'a t

promote monad into the transformation.

val run : 'a t -> env -> 'a monad

Run the reader and extract the value.

val ask : env t

Provides the monad environment.

val local : (env -> env) -> 'a t -> 'a t

Modify the environment and execute the reader.

val reader : (env -> 'a monad) -> 'a t

Build a reader from a function.