q4c12-twofinger

Efficient alternating finger trees

https://github.com/quasicomputational/mega/tree/master/packages/twofinger

Latest on Hackage:0.2

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD-2-Clause licensed and maintained by quasicomputational

This package provides efficient alternating sequences based on finger trees. These can represent sequences made up of two types of element, e and a where two of the same type of element cannot follow each other directly.

Four different flavours are provided, isomorphic to ([(a, e)], a), ([(e, a)], e), [(a, e)], and [(e, a)].

Cons-like operations are O(1) amortised, and append operations are O(log(min(n, m))) amortised.

For more details, please see the Haddock documentation of Q4C12.TwoFinger.