Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Data.Rope.UTF16
Synopsis
- data Rope
- null :: Rope -> Bool
- length :: Rope -> Int
- rows :: Rope -> Int
- columns :: Rope -> Int
- toText :: Rope -> Text
- toLazyText :: Rope -> Text
- fromText :: Text -> Rope
- toString :: Rope -> String
- map :: (Char -> Char) -> Rope -> Rope
- intercalate :: Rope -> [Rope] -> Rope
- toChunks :: Rope -> [Text]
- unconsChunk :: Rope -> Maybe (Text, Rope)
- unsnocChunk :: Rope -> Maybe (Rope, Text)
- splitAt :: Int -> Rope -> (Rope, Rope)
- take :: Int -> Rope -> Rope
- drop :: Int -> Rope -> Rope
- data RowColumn = RowColumn {}
- rowColumnCodeUnits :: RowColumn -> Rope -> Int
- codeUnitsRowColumn :: Int -> Rope -> RowColumn
- splitAtLine :: Int -> Rope -> (Rope, Rope)
- span :: (Char -> Bool) -> Rope -> (Rope, Rope)
- break :: (Char -> Bool) -> Rope -> (Rope, Rope)
- takeWhile :: (Char -> Bool) -> Rope -> Rope
- dropWhile :: (Char -> Bool) -> Rope -> Rope
- foldl :: (a -> Char -> a) -> a -> Rope -> a
- foldl' :: (a -> Char -> a) -> a -> Rope -> a
- foldr :: (Char -> a -> a) -> a -> Rope -> a
- any :: (Char -> Bool) -> Rope -> Bool
- all :: (Char -> Bool) -> Rope -> Bool
Documentation
A SplayTree
of Text
values optimised for being indexed by and
modified at UTF-16 code units and row/column (RowColumn
) positions.
Internal invariant: No empty Chunk
s in the SplayTree
Instances
Queries
The number of UTF-16 code units (not characters) since the last newline or the start of the rope
Since: 0.3.0.0
Conversions
toLazyText :: Rope -> Text #
Transformations
intercalate :: Rope -> [Rope] -> Rope #
Concatenate the interspersion of a rope between the elements of a list of ropes
Since: 0.3.0.0
Chunking
unconsChunk :: Rope -> Maybe (Text, Rope) #
Get the first chunk and the rest of the Rope
if non-empty
unsnocChunk :: Rope -> Maybe (Rope, Text) #
Get the last chunk and the rest of the Rope
if non-empty
UTF-16 code unit indexing
Constructors
RowColumn | |
rowColumnCodeUnits :: RowColumn -> Rope -> Int #
Get the UTF-16 code unit index in the rope that corresponds to a
RowColumn
position
Since: 0.2.0.0
codeUnitsRowColumn :: Int -> Rope -> RowColumn #
Get the RowColumn
position that corresponds to a UTF-16 code unit index
in the rope
Since: 0.3.2.0
splitAtLine :: Int -> Rope -> (Rope, Rope) #
Split the rope immediately after the i:th newline
Since: 0.3.1.0