chimera: Lazy infinite streams with O(1) indexing
There are plenty of memoizing libraries on Hackage, but they usually fall into two categories:
Store cache as a flat array, enabling us to obtain cached values in O(1) time, which is nice. The drawback is that one must specify the size of the array beforehand, limiting an interval of inputs, and actually allocate it at once.
Store cache as a lazy binary tree. Thanks to laziness, one can freely use the full range of inputs. The drawback is that obtaining values from a tree takes logarithmic time and is unfriendly to CPU cache, which kinda defeats the purpose.
This package intends to tackle both issues,
providing a data type
lazy infinite compact streams with cache-friendly O(1) indexing.
Additional features include:
memoization of recursive functions and recurrent sequences,
memoization of functions of several, possibly signed arguments,
efficient memoization of boolean predicates.
[Skip to Readme]
Define Representable instance from adjunctions package
Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info
- chimera-0.3.1.0.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
|Versions [RSS]||0.2.0.0, 0.3.0.0, 0.3.1.0, 0.3.2.0, 0.3.3.0|
|Dependencies||adjunctions, base (>=4.9 && <4.16), distributive, mtl, vector [details]|
|Revised||Revision 1 made by Bodigrim at 2022-06-18T16:01:43Z|
|Source repo||head: git clone https://github.com/Bodigrim/chimera|
|Uploaded||by Bodigrim at 2020-03-25T21:53:55Z|
|Distributions||Arch:0.3.3.0, LTSHaskell:0.3.3.0, NixOS:0.3.3.0, Stackage:0.3.3.0|
|Reverse Dependencies||2 direct, 7041 indirect [details]|
|Downloads||3312 total (87 in the last 30 days)|
|Rating||(no votes yet) [estimated by Bayesian average]|
|Status||Docs available [build log]
Last success reported on 2020-03-25 [all 1 reports]