This package provides methods for a computation which allows reading external records.
A Reader<R, A> object represents a computation, reading R and returning A:
Reader<R, A>
R
A
type Reader<R, A> = (record: R) => A;// Note that the actual code is defined as a special case of `ReaderT`. Copy
type Reader<R, A> = (record: R) => A;// Note that the actual code is defined as a special case of `ReaderT`.
And you can work with it by the following methods:
withReader
Reader
ask
compose
local
run
weaken
pure
map
apply
flatMap
Moreover a ReaderT<R, M, A> monad transformer is the generalized version of Reader<R, A>. It accepts not A, but object on monad M.
ReaderT<R, M, A>
M
Generated using TypeDoc
This package provides methods for a computation which allows reading external records.
A
Reader<R, A>
object represents a computation, readingR
and returningA
:And you can work with it by the following methods:
withReader
- Constructs a newReader
from your computation.ask
- Makes a pure computation reading the record.compose
- Composes twoReader
s.local
- Localizes record to be read.run
- Runs a computation with specified records.weaken
- Makes the record type weaker for application.pure
- Wraps a value into aReader
.map
- Transforms the resulting value ofReader
.apply
- Applies aReader
which results a function into another one.flatMap
- Applies a function which returnsReader
for the resulting value ofReader
.Moreover a
ReaderT<R, M, A>
monad transformer is the generalized version ofReader<R, A>
. It accepts notA
, but object on monadM
.