flux-monoid: A monoid for tracking changes

[ bsd3, data-structures, library ] [ Propose Tags ] [ Report a vulnerability ]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 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
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 842 total (0 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-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