update-monad

[ bsd3, library, unclassified ] [ Propose Tags ] [ Report a vulnerability ]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), mtl [details]
License BSD-3-Clause
Copyright 2018 Author name here
Author Author name here
Maintainer example@example.com
Home page https://github.com/githubuser/update-monad#readme
Bug tracker https://github.com/githubuser/update-monad/issues
Source repo head: git clone https://github.com/githubuser/update-monad
Uploaded by ChrisPenner at 2018-09-05T01:54:14Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 711 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2018-09-05 [all 1 reports]

Readme for update-monad-0.1.0.0

[back to package description]

Update Monad

The update monad is a generalized (and pretty abstract) monad which can be specialized to implement any of Reader, Writer, or State! Check out this paper for a description.

This repo implements both the update monad transformer (UpdateT) and an experiment called FreeUpdateT which forgoes the traditional requirement of using a monoid as the 'action' of the update monad by substituting a free monoid (i.e. [action]). It also defers the choice of an act :: action -> state -> state function until the last second when the monad is run (rather than using a typeclass); this conveniently allows you to substitute out the act function for testing or alternate behaviour without needing to rewrite or transform the monadic values themselves. Nifty!

Yes; I know I could implement Update in terms of UpdateT Identity; but implementing them separately is clearer for people learning how it works.