flux-monoid: A monoid for tracking changes

[ bsd3, data-structures, library ] [ Propose Tags ]




Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS]
Dependencies base (>=4.7 && <5) [details]
License BSD-3-Clause
Copyright 2018 Chris Penner
Author Chris Penner
Maintainer none
Category Data Structures
Home page https://github.com/githubuser/flux-monoid#readme
Source repo head: git clone https://github.com/ChrisPenner/flux-monoid
Uploaded by ChrisPenner at 2018-06-24T22:13:00Z
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 822 total (6 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-06-24 [all 1 reports]

Readme for flux-monoid-

[back to package description]


Flux is a monoid which counts the number of times an element changes (according to its Eq instance) This is useful for gaining associativity (and its associated performance improvements) for tasks where you'd otherwise use group or groupBy

It also allows usage of change-detection semantics in situations where a Monoid is required; e.g. in a FingerTree

> getFlux $ foldMap flux ["a", "b", "b", "a"]
> getFlux $ foldMap flux ["a", "b", "b", "a", "c", "c", "c"]