moo-nad: Invocation helpers for the ReaderT-record-of-functions style.

[ bsd3, control, library ] [ Propose Tags ]

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 using HasX-style typeclasses.

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 ReaderT-record-of-functions 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.

Signatures

  • Moo

Modules

[Last Documentation]

  • Moo
    • Moo.Prelude

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.1, 0.1.0.2
Change log CHANGELOG.md
Dependencies base (>=4.15.0.0 && <4.16), dep-t (>=0.4.4 && <0.5), moo-nad, mtl (>=2.2 && <2.3), transformers (>=0.5 && <0.6) [details]
License BSD-3-Clause
Author Daniel Diaz Carrete
Maintainer diaz_carrete@yahoo.com
Uploaded by DanielDiazCarrete at 2021-05-23T13:26:19Z
Distributions
Downloads 219 total (8 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2021-05-29 [all 5 reports]