yi-0.6.5.0: The Haskell-Scriptable Editor

Safe HaskellSafe-Infered

Data.Rope

Contents

Description

This module defines a Rope representation.

Synopsis

Documentation

data Rope Source

Instances

Conversions to Rope

Conversions from Rope

List-like functions

append :: Rope -> Rope -> RopeSource

Append two strings by merging the two finger trees.

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

Split the string at the specified position.

splitAtLine :: Int -> Rope -> (Rope, Rope)Source

Split before the specified line. Lines are indexed from 0.

length :: Rope -> IntSource

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.)

IO

Low level functions

splitAtChunkBefore :: Int -> Rope -> (Rope, Rope)Source

Split the rope on a chunk, so that the desired position lies within the first chunk of the second rope.