structs-0: Strict GC'd imperative object-oriented programming with cheap pointers.

Copyright(C) 2015 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Struct.Label

Description

 

Synopsis

Documentation

data Label s Source

Logarithmic time list labeling solution

Instances

new :: PrimMonad m => m (Label (PrimState m)) Source

O(1). Create a new labeling structure. Labels from different list labeling structures are incomparable.

insertAfter :: PrimMonad m => Label (PrimState m) -> m (Label (PrimState m)) Source

O(log n) amortized. Insert a new label after a given label.

delete :: PrimMonad m => Label (PrimState m) -> m () Source

O(1). Remove a label

least :: PrimMonad m => Label (PrimState m) -> m (Label (PrimState m)) Source

O(n). Retrieve the least label

greatest :: PrimMonad m => Label (PrimState m) -> m (Label (PrimState m)) Source

O(n). Retrieve the greatest label

cutAfter :: PrimMonad m => Label (PrimState m) -> m () Source

O(1). Split off all labels after the current label.

cutBefore :: PrimMonad m => Label (PrimState m) -> m () Source

O(1). Split off all labels before the current label.

compareM :: PrimMonad m => Label (PrimState m) -> Label (PrimState m) -> m Ordering Source

O(1). Compare two labels for ordering.