flux-monoid: A monoid for tracking changes

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

[Skip to Readme]
Versions [faq] 0.1.0.0
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:0.1.0.0
Downloads 571 total (1 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]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for flux-monoid-0.1.0.0

[back to package description]

flux-monoid

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"]
2
> getFlux $ foldMap flux ["a", "b", "b", "a", "c", "c", "c"]
3