| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Toml.Bi.Monad
Description
Contains general underlying monad for bidirectional TOML converion.
Documentation
data Bijection r w c a Source #
Monad for bidirectional Toml conversion. Contains pair of functions:
- How to read value of type
afrom immutable environment contextr? - How to store value of type
ain stateful contextw?
In practice instead of r we will use some Reader Toml and instead of w we will
use State Toml. This approach with the bunch of utility functions allows to
have single description for from/to Toml conversion.
In practice this type will always be used in the following way:
typeBir w a =Bijectionr w a a
Type parameter c if fictional. Here some trick is used. This trick is
implemented in codec and
described in more details in related blog post.
Constructors
| Bijection | |
type Bi r w a = Bijection r w a a Source #
Specialized version of Bijection data type. This type alias is used in practice.