Monad.Reader
The Reader monad.
Monad that encapsulates a read-only value/shared environment.
Examples
iex> require Monad.Reader, as: Reader
iex> import Reader
iex> r = Reader.m do
...> let a = 2
...> b <- ask
...> return a + b
...> end
iex> Reader.run(10, r)
12
Summary
Functions
Ask for the Reader monad’s value
Callback implementation for Monad.bind/2
Set a different value locally for the Reader monad
Inject x
into a Reader monad
Run Reader monad r
by supplying it with value x
Types
Functions
Callback implementation for Monad.bind/2
.
Set a different value locally for the Reader monad.
Macros
Monad do-notation.
See the Monad
module documentation and the
Monad.Reader
module documentation