HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

newtypenewtype Rope
#

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 Chunks in the SplayTree

Instances7Eq, Ord, Show, IsString, Semigroup, Monoid, …
  • Eq RopeDefined in rope-utf16-splay-0.4.0.0 · Data.Rope.UTF16.Internal
  • Ord RopeDefined in rope-utf16-splay-0.4.0.0 · Data.Rope.UTF16.Internal
  • Show RopeDefined in rope-utf16-splay-0.4.0.0 · Data.Rope.UTF16.Internal
  • IsString RopeDefined in rope-utf16-splay-0.4.0.0 · Data.Rope.UTF16.Internal
  • Semigroup RopeDefined in rope-utf16-splay-0.4.0.0 · Data.Rope.UTF16.Internal

    Append joins adjacent chunks if that can be done while staying below chunkLength.

  • Monoid RopeDefined in rope-utf16-splay-0.4.0.0 · Data.Rope.UTF16.Internal
  • Measured Position RopeDefined in rope-utf16-splay-0.4.0.0 · Data.Rope.UTF16.Internal

Queries

4 declarations
valuelength :: Rope -> Int
#

Length in UTF-16 code units (not characters)

valuerows :: Rope -> Int
#

The number of newlines in the rope

valuecolumns :: Rope -> Int
#

The number of UTF-16 code units (not characters) since the last newline or the start of the rope

Conversions

4 declarations

Transformations

2 declarations
valueintercalate :: Rope -> [Rope] -> Rope
#

Concatenate the interspersion of a rope between the elements of a list of ropes

Chunking

3 declarations

UTF-16 code unit indexing

7 declarations
valuetake :: Int -> Rope -> Rope
#

Take the first n UTF-16 code units (not characters)

valuedrop :: Int -> Rope -> Rope
#

Drop the first n UTF-16 code units (not characters)

datadata RowColumn
#

Constructors

  • RowColumn
    • row :: !Int

      Number of newlines before this position

    • column :: !Int

      Number of UTF-16 code units since last newline or start of string

Instances5Eq, Ord, Show, Semigroup, Monoid
  • Eq RowColumnDefined in rope-utf16-splay-0.4.0.0 · Data.Rope.UTF16.Internal.Position
  • Ord RowColumnDefined in rope-utf16-splay-0.4.0.0 · Data.Rope.UTF16.Internal.Position
  • Show RowColumnDefined in rope-utf16-splay-0.4.0.0 · Data.Rope.UTF16.Internal.Position
  • Semigroup RowColumnDefined in rope-utf16-splay-0.4.0.0 · Data.Rope.UTF16.Internal.Position
  • Monoid RowColumnDefined in rope-utf16-splay-0.4.0.0 · Data.Rope.UTF16.Internal.Position

Breaking by predicate

4 declarations

Folds

3 declarations

Special folds

2 declarations
valueany :: (Char -> Bool) -> Rope -> Bool
#

Do any characters in the rope satisfy the predicate?

valueall :: (Char -> Bool) -> Rope -> Bool
#

Do all characters in the rope satisfy the predicate?