rope-utf16-splay-0.1.0.0: Ropes optimised for updating using UTF-16 code points and row/column pairs.

Safe HaskellNone
LanguageHaskell2010

Data.Rope.UTF16

Contents

Synopsis

Documentation

data Rope Source #

A SplayTree of Text values optimised for being indexed by and modified at UTF-16 code points and row/column (RowColumn) positions. Internal invariant: No empty Chunks in the SplayTree

Instances

Eq Rope Source # 

Methods

(==) :: Rope -> Rope -> Bool #

(/=) :: Rope -> Rope -> Bool #

Ord Rope Source # 

Methods

compare :: Rope -> Rope -> Ordering #

(<) :: Rope -> Rope -> Bool #

(<=) :: Rope -> Rope -> Bool #

(>) :: Rope -> Rope -> Bool #

(>=) :: Rope -> Rope -> Bool #

max :: Rope -> Rope -> Rope #

min :: Rope -> Rope -> Rope #

Show Rope Source # 

Methods

showsPrec :: Int -> Rope -> ShowS #

show :: Rope -> String #

showList :: [Rope] -> ShowS #

IsString Rope Source # 

Methods

fromString :: String -> Rope #

Semigroup Rope Source #

Append joins adjacent chunks if that can be done while staying below chunkLength.

Methods

(<>) :: Rope -> Rope -> Rope #

sconcat :: NonEmpty Rope -> Rope #

stimes :: Integral b => b -> Rope -> Rope #

Monoid Rope Source # 

Methods

mempty :: Rope #

mappend :: Rope -> Rope -> Rope #

mconcat :: [Rope] -> Rope #

Measured Position Rope Source # 

Conversions to and from Text and String

Chunking

toChunks :: Rope -> [Text] Source #

The raw Text data that the Rope is built from

unconsChunk :: Rope -> Maybe (Text, Rope) Source #

Get the first chunk and the rest of the Rope if non-empty

unsnocChunk :: Rope -> Maybe (Rope, Text) Source #

Get the last chunk and the rest of the Rope if non-empty

UTF-16 code point indexing

length :: Rope -> Int Source #

Length in code points (not characters)

splitAt :: Int -> Rope -> (Rope, Rope) Source #

Split the rope at the nth code point (not character)

take :: Int -> Rope -> Rope Source #

Take the first n code points (not characters)

drop :: Int -> Rope -> Rope Source #

Drop the first n code points (not characters)

rowColumnCodePoints :: RowColumn -> Rope -> Int Source #

Get the code point index in the rope that corresponds to a RowColumn position

Breaking by predicate

span :: (Char -> Bool) -> Rope -> (Rope, Rope) Source #

break :: (Char -> Bool) -> Rope -> (Rope, Rope) Source #