update-monad

[ bsd3, library, unclassified ] [ Propose Tags ]

Please see the README on GitHub at https://github.com/githubuser/update-monad#readme


[Skip to Readme]
Versions [faq] 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 Wed Sep 5 01:54:14 UTC 2018
Distributions NixOS:0.1.0.0
Downloads 183 total (15 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-09-05 [all 1 reports]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


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.