type-aligned-0.9: Various type-aligned sequence data structures.

Copyright(c) Atze van der Ploeg 2014
LicenseBSD-style
Maintaineratzeus@gmail.org
Stabilityprovisional
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell98

Data.TASequence.FastQueue

Description

A type aligned sequence, a queue, with worst case constant time: |>, and tviewl.

Based on: "Simple and Efficient Purely Functional Queues and Deques", Chris Okasaki, Journal of Functional Programming 1995

Documentation

revAppend :: ConsList tc a b -> SnocList tc b d -> ConsList tc a d Source

rotate :: ConsList tc a b -> SnocList tc b c -> ConsList tc c d -> ConsList tc a d Source

data FastQueue tc a b where Source

Constructors

RQ :: !(ConsList tc a b) -> !(SnocList tc b c) -> !(ConsList tc x b) -> FastQueue tc a c 

queue :: ConsList tc a b -> SnocList tc b c -> ConsList tc x b -> FastQueue tc a c Source