Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Chunk = Chunk {
- chunkText :: !Text
- chunkMeasure :: !Position
- chunk :: Text -> Chunk
- newtype Rope = Rope {}
- chunkLength :: Int
- null :: Rope -> Bool
- length :: Rope -> Int
- rows :: Rope -> Int
- columns :: Rope -> Int
- toText :: Rope -> Text
- toLazyText :: Rope -> Text
- fromText :: Text -> Rope
- fromShortText :: 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
- 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
Chunk | |
|
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
Eq Rope Source # | |
Ord Rope Source # | |
Show Rope Source # | |
IsString Rope Source # | |
Defined in Data.Rope.UTF16.Internal fromString :: String -> Rope # | |
Semigroup Rope Source # | Append joins adjacent chunks if that can be done while staying below
|
Monoid Rope Source # | |
Measured Position Rope Source # | |
chunkLength :: Int Source #
The maximum length, in code units, of a chunk
Queries
columns :: Rope -> Int Source #
The number of code units (not characters) since the last newline or the start of the rope
Since: 0.3.0.0
Conversions
toLazyText :: Rope -> Text Source #
fromShortText :: Text -> Rope Source #
Transformations
intercalate :: Rope -> [Rope] -> Rope Source #
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) 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 unit indexing
rowColumnCodeUnits :: RowColumn -> Rope -> Int Source #
Get the code unit index in the rope that corresponds to a RowColumn
position
Since: 0.2.0.0
codeUnitsRowColumn :: Int -> Rope -> RowColumn Source #
Get the RowColumn
position that corresponds to a code unit
index in the rope
Since: 0.3.2.0
Lines
splitAtLine :: Int -> Rope -> (Rope, Rope) Source #
Split the rope immediately after the i:th newline
Since: 0.3.1.0