Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Rope
- toText :: Rope -> Text
- toLazyText :: Rope -> Text
- fromText :: Text -> Rope
- toString :: Rope -> String
- toChunks :: Rope -> [Text]
- unconsChunk :: Rope -> Maybe (Text, Rope)
- unsnocChunk :: Rope -> Maybe (Rope, Text)
- length :: Rope -> Int
- splitAt :: Int -> Rope -> (Rope, Rope)
- take :: Int -> Rope -> Rope
- drop :: Int -> Rope -> Rope
- rowColumnCodePoints :: RowColumn -> Rope -> Int
- span :: (Char -> Bool) -> Rope -> (Rope, Rope)
- break :: (Char -> Bool) -> Rope -> (Rope, Rope)
- takeWhile :: (Char -> Bool) -> Rope -> Rope
- dropWhile :: (Char -> Bool) -> Rope -> Rope
Documentation
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 Chunk
s in the SplayTree
Conversions to and from Text
and String
toLazyText :: Rope -> Text Source #
Chunking
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
rowColumnCodePoints :: RowColumn -> Rope -> Int Source #
Get the code point index in the rope that corresponds to a RowColumn
position