moo-nad: Invocation helpers for the ReaderT-record-of-functions style.
Using a record-of-functions as the environment of some reader-like monad is a common way of structuring Haskell applications, somewhat resembling dependency injection in OOP.
We often want our program logic to be polymorphic over both the
concrete monad and the environment. One common solution is to
abstract the monad using
MonadReader, and abstract the environment
One minor annoyance though is that invoking the function in the environment is often a bit cumbersome: you have to ask the environment for the function, and then lift the result of the function back into the reader-like monad.
This library supports a special twist on
style: instead of depending only on typeclasses for abstraction,
we also use a module signature. This comes with different tradeoffs.
One benefit is that we support a simpler way of invoking functions from the environment, using a helper that takes care of both asking the environment and lifting function results, and which works uniformly for functions of any arity.
[Skip to Readme]
|Versions [RSS]||0.1.0.1, 0.1.0.2|
|Dependencies||base (>=126.96.36.199 && <5), dep-t (>=0.4.4 && <0.5), moo-nad, mtl (>=2.2 && <2.3), transformers (>=0.5 && <0.6) [details]|
|Author||Daniel Diaz Carrete|
|Source repo||head: git clone https://github.com/danidiaz/moo-nad.git|
|Uploaded||by DanielDiazCarrete at 2021-05-23T13:47:53Z|
|Downloads||190 total (1 in the last 30 days)|
|Rating||(no votes yet) [estimated by Bayesian average]|
|Status||Docs uploaded by user [build log]
Last success reported on 2021-05-23 [all 1 reports]