Safe Haskell | Safe-Infered |
---|
This module defines a Rope representation.
- data Rope
- fromString :: String -> Rope
- toString :: Rope -> String
- toReverseString :: Rope -> String
- null :: Rope -> Bool
- empty :: Rope
- take, drop :: Int -> Rope -> Rope
- append :: Rope -> Rope -> Rope
- splitAt :: Int -> Rope -> (Rope, Rope)
- splitAtLine :: Int -> Rope -> (Rope, Rope)
- length :: Rope -> Int
- reverse :: Rope -> Rope
- countNewLines :: Rope -> Int
- readFile :: FilePath -> IO Rope
- writeFile :: FilePath -> Rope -> IO ()
- splitAtChunkBefore :: Int -> Rope -> (Rope, Rope)
Documentation
Conversions to Rope
fromString :: String -> RopeSource
Conversions from Rope
toReverseString :: Rope -> StringSource
List-like functions
splitAtLine :: Int -> Rope -> (Rope, Rope)Source
Split before the specified line. Lines are indexed from 0.
Get the length of the string. (This information cached, so O(1) amortized runtime.)
countNewLines :: Rope -> IntSource
Count the number of newlines in the strings. (This information cached, so O(1) amortized runtime.)