text-rope: Text lines and ropes

[ bsd3, library, text ] [ Propose Tags ] [ Report a vulnerability ]

A wrapper around Text for fast line/column navigation and logarithmic concatenation.


[Skip to Readme]

Flags

Manual Flags

NameDescriptionDefault
debug

Build library with sanity checks enabled.

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1, 0.2, 0.3
Change log changelog.md
Dependencies base (>=4.9 && <5), deepseq (<1.6), text (>=1.2.3 && <2.2), vector (>=0.11 && <0.14) [details]
Tested with ghc ==9.10.1, ghc ==9.8.2, ghc ==9.6.5, ghc ==9.4.8, ghc ==9.2.8, ghc ==9.0.2, ghc ==8.10.7, ghc ==8.8.4, ghc ==8.6.5, ghc ==8.4.4, ghc ==8.2.2, ghc ==8.0.2
License BSD-3-Clause
Copyright 2021-2022 Andrew Lelechenko, 2024 Olle Fredriksson
Author Andrew Lelechenko <andrew.lelechenko@gmail.com>, Olle Fredriksson <fredriksson.olle@gmail.com>
Maintainer Andrew Lelechenko <andrew.lelechenko@gmail.com>
Category Text
Home page https://github.com/Bodigrim/text-rope
Source repo head: git clone git://github.com/Bodigrim/text-rope.git
Uploaded by Bodigrim at 2024-07-17T18:07:02Z
Distributions Arch:0.3, LTSHaskell:0.2, NixOS:0.2, Stackage:0.2
Reverse Dependencies 9 direct, 44 indirect [details]
Downloads 3381 total (165 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2024-07-17 [all 1 reports]

Readme for text-rope-0.3

[back to package description]

text-rope Hackage Stackage LTS Stackage Nightly

A wrapper around Text for fast line/column navigation and logarithmic concatenation.

Here are benchmarks for 1000 edits over 70K text:

Split at position
  Unicode
    text-rope:
      3.09 ms ±  94 μs
    yi-rope:
      49.4 ms ± 1.4 ms, 15.98x
  UTF-16
    text-rope:
      3.09 ms ± 106 μs
    rope-utf16-splay:
      10.6 ms ± 337 μs, 3.44x
Split at offset
  Unicode
    text-rope:
      3.04 ms ± 112 μs
    core-text:
      14.0 ms ± 297 μs, 4.59x
    yi-rope:
      6.25 ms ± 102 μs, 2.06x
  UTF-16
    text-rope:
      3.40 ms ±  70 μs
    rope-utf16-splay:
      8.92 ms ± 169 μs, 2.62x

For 10000 edits over 700K text:

Split at position
  Unicode
    text-rope:
      62.9 ms ± 4.2 ms
    yi-rope:
      568  ms ±  31 ms, 9.04x
  UTF-16
    text-rope:
      61.0 ms ± 3.9 ms
    rope-utf16-splay:
      325  ms ±  13 ms, 5.32x
Split at offset
  Unicode
    text-rope:
      59.6 ms ± 3.8 ms
    core-text:
      209  ms ±  15 ms, 3.50x
    yi-rope:
      105  ms ± 7.4 ms, 1.76x
  UTF-16
    text-rope:
      63.6 ms ± 5.3 ms
    rope-utf16-splay:
      230  ms ± 9.0 ms, 3.62x

For 100000 edits over 7M text:

Split at position
  Unicode
    text-rope:
      963  ms ±  43 ms
    yi-rope:
      6.379 s ± 138 ms, 6.62x
  UTF-16
    text-rope:
      988  ms ±  19 ms
    rope-utf16-splay: T
      57.408 s ± 4.24 s, 58.12x
Split at offset
  Unicode
    text-rope:
      1.014 s ±  70 ms
    core-text:
      3.008 s ± 138 ms, 2.97x
    yi-rope:
      1.716 s ±  76 ms, 1.69x
  UTF-16
    text-rope:
      1.065 s ±  53 ms
    rope-utf16-splay:
      38.852 s ± 568 ms, 36.49x