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

Data.Rope.Annotated

Contents

Synopsis

Annotated Ropes

data A s a Source

Instances

Measured Offset (A s a) 
Functor (A s) 
Foldable (A s) 
Traversable (A s) 
Comonad (A s) 

type Ann a f = A a (f a)Source

class MonoidA f Source

Instances

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

class MonoidA f => ReducerA f Source

Instances

class BreakableA f Source

Instances

runAnn :: Ann a f -> (forall b. Ann b f -> r) -> rSource

Unpacking Ropes

null :: A s a -> BoolSource

head :: Unpackable t => A s a -> tSource

last :: Unpackable t => A s a -> tSource

unpack :: Unpackable t => A s a -> [t]Source

Building Annotated Rope

append :: MonoidA f => Ann a f -> Ann b f -> Ann (a :<> b) fSource

unit :: (ReducerA f, Reducer t Rope) => t -> (forall a. Ann (Return a) f -> r) -> rSource

snoc :: (ReducerA f, Reducer t Rope) => Ann a f -> t -> (forall c. Ann (Snoc a c t) f -> r) -> rSource

cons :: (ReducerA f, Reducer t Rope) => t -> Ann a f -> (forall c. Ann (Cons c t a) f -> r) -> rSource

Cutting An Annotated Rope

splitAt :: BreakableA f => Int -> Ann a f -> (forall n. Ann (Take n a) f -> Ann (Drop n a) f -> r) -> rSource

drop :: BreakableA f => Int -> Ann a f -> (forall n. Ann (Drop n a) f -> r) -> rSource

take :: BreakableA f => Int -> Ann a f -> (forall n. Ann (Take n a) f -> r) -> rSource

break :: (BreakableA f, Breakable t) => (t -> Bool) -> Ann a f -> (forall n. Ann (Take n a) f -> Ann (Drop n a) f -> r) -> rSource

span :: (BreakableA f, Breakable t) => (t -> Bool) -> Ann a f -> (forall n. Ann (Take n a) f -> Ann (Drop n a) f -> r) -> rSource

takeWhile :: (BreakableA f, Breakable t) => (t -> Bool) -> Ann a f -> (forall n. Ann (Take n a) f -> r) -> rSource

dropWhile :: (BreakableA f, Breakable t) => (t -> Bool) -> Ann a f -> (forall n. Ann (Drop n a) f -> r) -> rSource

Inspecting the ends of the Rope

uncons :: (BreakableA f, Unpackable t) => Ann a f -> Maybe (t, Ann (Tail t a) f)Source

unsnoc :: (BreakableA f, Unpackable t) => Ann a f -> Maybe (Ann (Init a t) f, t)Source

Type-level constructors

type family Drop n a :: *Source

type family Take n a :: *Source

type Snoc a s t = a :<> Return (Token s t)Source

type Cons s t a = Token s t :> aSource

type Tail t a = Unit (Tailed t a)Source

type Init a t = Unit (Inited a t)Source

type Return a = a :> NilSource

data Nil Source

type family a :<> b :: *Source

Annotations

Annotation Product

data (f :*: g) a Source

A Rope Annotation product.

Constructors

(f a) :*: (g a) 

Instances

(Functor f, Functor g) => Functor (:*: f g) 
(Applicative f, Applicative g) => Applicative (:*: f g) 
(Foldable f, Foldable g) => Foldable (:*: f g) 
(Traversable f, Traversable g) => Traversable (:*: f g) 
(BreakableA f, BreakableA g) => BreakableA (:*: f g) 
(ReducerA f, ReducerA g) => ReducerA (:*: f g) 
(MonoidA f, MonoidA g) => MonoidA (:*: f g) 

fstF :: (f :*: g) a -> f aSource

sndF :: (f :*: g) a -> g aSource

Annotation Unit