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

Data.Rope.Annotation

Documentation

class MonoidA f whereSource

Methods

emptyA :: f aSource

build an empty Annotation

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

append two annotations

Instances

MonoidA Unit 
(MonoidA f, MonoidA g) => MonoidA (:*: f g) 

class MonoidA f => ReducerA f whereSource

Methods

unitA :: Rope -> f aSource

construct an Annotation from a Rope out of whole cloth

snocA :: 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

consA :: 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

Instances

class BreakableA f whereSource

Methods

splitAtA :: 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

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

truncate the Annotation to length n

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

drop the first n bytes from the Annotation

Instances