type-indexed-queues-0.1.0.1: Queues with verified and unverified versions.
Data.Queue.Indexed.Pairing
Description
Size-indexed pairing heaps.
Synopsis
data Pairing n a where Source #
A simple size-indexed pairing heap. In practice, this heap seems to have the best performance.
Inspired by the implementation here, but uses type-level literals, rather than type-level Peano numbers.
Constructors
Instances
Methods
merge :: Pairing n a -> Pairing m a -> Pairing (n + m) a Source #
empty :: Pairing 0 a Source #
minView :: Pairing (1 + n) a -> (a, Pairing n a) Source #
singleton :: a -> Pairing 1 a Source #
insert :: a -> Pairing n a -> Pairing (1 + n) a Source #
minViewMay :: Pairing n a -> ((Nat ~ n) 0 -> b) -> (forall m. (Nat ~ (1 + m)) n => a -> Pairing m a -> b) -> b Source #
rnf :: Pairing n a -> () #
data HVec n a where Source #
A size-indexed vector of pairing heaps.
rnf :: HVec n a -> () #