Sequences and measured sequences.
Sequences and measured sequences with logarithmic time index, split, append.
seqn
seqn
offers two sequence types:
Seq
, an immutable sequence supporting operations such as index, insert, delete, split, append, in logarithmic time.Seq
is well-suited to use cases where there are frequent changes to the structure of the sequence.MSeq
, a sequence likeSeq
, which additionally supports constant time access to the accumulated "measure" of all its elements. See the documentation forMSeq
for more about measures.
seqn
also offers a priority-queue structure, PQueue
, with logarithmic time queue operations.
Documentation
Please find the documentation on Hackage: seqn
Alternatives
The following structures are similar to Seq
and MSeq
, but may be better suited to some use cases.
- Alternatives to
Seq
:Data.Sequence.Seq
fromcontainers
Data.RRBVector.Vector
fromrrb-vector
- Alternatives to
MSeq
:Data.FingerTree.FingerTree
fromfingertree
For a detailed comparison, see here.
Acknowledgements
The interface and implementation of seqn
is largely influenced by the libraries containers
and fingertree
.
Contributing
Questions, bug reports, documentation improvements, code contributions welcome! Please open an issue as the first step.