circular: Circular fixed-sized mutable vectors

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

Please see the README on GitHub at https://github.com/dschrempf/circular#readme


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0, 0.1.1, 0.2.0, 0.3.0, 0.3.1, 0.3.1.1, 0.4.0.0, 0.4.0.1, 0.4.0.2, 0.4.0.3
Change log ChangeLog.md
Dependencies aeson, base (>=4.7 && <5), vector [details]
License BSD-3-Clause
Copyright Dominik Schrempf (2020)
Author Dominik Schrempf
Maintainer dominik.schrempf@gmail.com
Category Math, Data Structures
Home page https://github.com/dschrempf/circular#readme
Bug tracker https://github.com/dschrempf/circular/issues
Source repo head: git clone https://github.com/dschrempf/circular
Uploaded by dschrempf at 2020-06-20T20:14:53Z
Distributions LTSHaskell:0.4.0.3, NixOS:0.4.0.3, Stackage:0.4.0.3
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1492 total (35 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-06-20 [all 1 reports]

Readme for circular-0.1.1

[back to package description]

Circular

Circular fixed-sized stacks.

Circular stacks with fxed maximum size are just normal vectors with a pointer to the last element. They are useful because

  • memory usage is constant
  • they are fast, especially when summary statistics need to be computed across the stack (use unsafePush, if possible)
  • they can be saved, and restored using JSON format

When the stack is full, new, pushed elements replace the oldest (deepest) elements on the stack. Complex circular behavior can arise when pushes and pops are mixed. QuickCheck and unit tests with HSpec give promising results — have a look yourself.

I use circular stacks, for example, as the data type for traces of Markov chains.

Circular is actively developed and functions may be removed, renamed, or changed. New ideas are welcome!