flux-monoid: A monoid for tracking changes

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

[Skip to Readme]
Versions [RSS] [faq]
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
Distributions NixOS:
Downloads 630 total (6 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-06-24 [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees


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"]