rope-0.6: Tools for manipulating fingertrees of bytestrings with optional annotations

Data.Rope.Annotation

Documentation

class MonoidalAnn f whereSource

Methods

emptyAnn :: f aSource

build an empty Annotation

appendAnn :: Rope -> f a -> Rope -> f b -> f cSource

append two annotations, based on their corresponding ropes

class MonoidalAnn f => PackableAnn f whereSource

Methods

packAnn :: Rope -> f aSource

construct an Annotation from a Rope out of whole cloth

snocAnn :: Int -> Rope -> f a -> f bSource

The Rope has been updated to contains n more bytes on the right than the one used to build the Annotation, update the Annotation

consAnn :: Int -> Rope -> f a -> f bSource

The Rope contains n more bytes on the left than the one used to build the Annotation, update the Annotation

class BreakableAnn f whereSource

Methods

splitAtAnn :: Int -> Rope -> f a -> (f b, f c)Source

split an Annotation about a Rope into two annotations, one about the first n bytes, the other about the remainder

takeAnn :: Int -> Rope -> f a -> f bSource

truncate the Annotation to length n

dropAnn :: Int -> Rope -> f a -> f bSource

drop the first n bytes from the Annotation