Îõ³h$:t8Qä      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abc(c) 2021-2022 Andrew LelechenkoBSD3/Andrew Lelechenko None Ç * text-ropeRepresent a position in a text. text-ropeLine. text-ropeColumn in code points. text-ropeA wrapper around dà for fast line/column navigation. Concatenation takes linear time.This is a building block for ,, which provides logarithmic concatenation. text-ropeExtract d, O(1). text-rope Create from d, linear time. text-rope$Check whether a text is empty, O(1). text-ropeEquivalent to   .  , but in O(1).:set -XOverloadedStringslengthInLines ""0lengthInLines "foo"1lengthInLines "foo\n"1lengthInLines "foo\n\n"2lengthInLines "foo\nbar"2  text-ropeSplit into lines by \n , similar to  Data.Text. !. Each line is produced in O(1).:set -XOverloadedStringslines ""[] lines "foo"["foo"] lines "foo\n"["foo"]lines "foo\n\n" ["foo",""]lines "foo\nbar" ["foo","bar"]  text-ropeSplit at given line, O(1).:set -XOverloadedStrings+map (\l -> splitAtLine l "foo\nbar") [0..3]Á[("","foo\nbar"),("foo\n","bar"),("foo\nbar",""),("foo\nbar","")]  text-rope"Length in code points, similar to  Data.Text. . Takes linear time.:set -XOverloadedStrings length "fÏ€€"3"Data.Text.Utf16.Lines.length "fÏ€€"4  text-ropeìMeasure text length as an amount of lines and columns. Time is proportional to the length of the last line.:set -XOverloadedStringslengthAsPosition "f€€"%Position {posLine = 0, posColumn = 2}lengthAsPosition "f\n€€"%Position {posLine = 1, posColumn = 1}lengthAsPosition "f\n€€\n"%Position {posLine = 2, posColumn = 0}  text-rope Span by a predicate, similar to  Data.Text. È. Takes linear (by length of the prefix satisfying the predicate) time. text-ropeCombination of   and subsequent . Time is linear in , but does not depend on .:set -XOverloadedStrings&splitAtPosition (Position 1 0) "f\n€€Ï" ("f\n","€€Ï")&splitAtPosition (Position 1 1) "f\n€€Ï" ("f\n€€","Ï")&splitAtPosition (Position 1 2) "f\n€€Ï" ("f\n€€Ï","")&splitAtPosition (Position 0 2) "f\n€€Ï" ("f\n","€€Ï")&splitAtPosition (Position 0 3) "f\n€€Ï" ("f\n€€","Ï")&splitAtPosition (Position 0 4) "f\n€€Ï" ("f\n€€Ï","") text-rope&Split at given code point, similar to  Data.Text. . Takes linear time.:set -XOverloadedStrings"map (\c -> splitAt c "fÏ€€") [0..4]8[("","fÏ€€"),("f","Ï€€"),("fÏ","€€"),("fÏ€€",""),("fÏ€€","")]e text-rope!Associativity does not hold when  overflows.fg hijk(c) 2021-2022 Andrew LelechenkoBSD3/Andrew Lelechenko None ³    (c) 2021-2022 Andrew LelechenkoBSD3/Andrew Lelechenko None2ÁÂÎÑà3  text-ropeRope of dã chunks with logarithmic concatenation. This rope offers an interface, based on code points. Use Data.Text.Utf16.Rope%, if you need UTF-16 code units, or Data.Text.Utf16.Rope.Mixed, if you need both interfaces. text-rope$Check whether a rope is empty, O(1). text-rope"Length in code points, similar to  Data.Text. , O(1).:set -XOverloadedStrings length "fÏ€€"3!Data.Text.Utf16.Rope.length "fÏ€€"4 text-rope splitAt c "fÏ€€") [0..4]8[("","fÏ€€"),("f","Ï€€"),("fÏ","€€"),("fÏ€€",""),("fÏ€€","")] text-rope&Split at given line, logarithmic time.:set -XOverloadedStrings+map (\l -> splitAtLine l "foo\nbar") [0..3]Á[("","foo\nbar"),("foo\n","bar"),("foo\nbar",""),("foo\nbar","")] text-ropeCombination of  and subsequent . Time is linear in  and logarithmic in .:set -XOverloadedStrings&splitAtPosition (Position 1 0) "f\n€€Ï" ("f\n","€€Ï")&splitAtPosition (Position 1 1) "f\n€€Ï" ("f\n€€","Ï")&splitAtPosition (Position 1 2) "f\n€€Ï" ("f\n€€Ï","")&splitAtPosition (Position 0 2) "f\n€€Ï" ("f\n","€€Ï")&splitAtPosition (Position 0 3) "f\n€€Ï" ("f\n€€","Ï")&splitAtPosition (Position 0 4) "f\n€€Ï" ("f\n€€Ï","")(c) 2021-2022 Andrew LelechenkoBSD3/Andrew Lelechenko None ÇÎï& text-ropeRepresent a position in a text.( text-ropeLine.) text-ropeColumn in UTF-16 code units.* text-rope0Length in UTF-16 code units. Takes linear time.:set -XOverloadedStrings length "fÏ€€"4Data.Text.Lines.length "fÏ€€"3+ text-ropeìMeasure text length as an amount of lines and columns. Time is proportional to the length of the last line.:set -XOverloadedStringslengthAsPosition "f€€"%Position {posLine = 0, posColumn = 3}lengthAsPosition "f\n€€"%Position {posLine = 1, posColumn = 2}lengthAsPosition "f\n€€\n"%Position {posLine = 2, posColumn = 0}, text-ropeCombination of   and subsequent -É. If requested number of code units splits a code point in half, return l. Time is linear in ), but does not depend on (.:set -XOverloadedStrings&splitAtPosition (Position 1 0) "f\n€€Ï"Just ("f\n","€€Ï")&splitAtPosition (Position 1 1) "f\n€€Ï"Nothing&splitAtPosition (Position 1 2) "f\n€€Ï"Just ("f\n€€","Ï")&splitAtPosition (Position 0 2) "f\n€€Ï"Just ("f\n","€€Ï")&splitAtPosition (Position 0 3) "f\n€€Ï"Nothing&splitAtPosition (Position 0 4) "f\n€€Ï"Just ("f\n€€","Ï")- text-ropeèSplit at given UTF-16 code unit. If requested number of code units splits a code point in half, return l. Takes linear time.:set -XOverloadedStrings"map (\c -> splitAt c "fÏ€€") [0..4]É[Just ("","fÏ€€"),Just ("f","Ï€€"),Just ("fÏ","€€"),Nothing,Just ("fÏ€€","")]/ text-rope!Associativity does not hold when ( overflows. &'()*+,-  *-&'()+,(c) 2021-2022 Andrew LelechenkoBSD3/Andrew Lelechenko None2ÁÂÎÑà(‰ 4 text-ropeRope of dé chunks with logarithmic concatenation. This rope offers an interface, based on UTF-16 code units. Use Data.Text.Rope, if you need code points, or Data.Text.Utf16.Rope.Mixed, if you need both interfaces.5 text-rope$Check whether a rope is empty, O(1).6 text-rope"Length in UTF-16 code units, O(1).:set -XOverloadedStrings length "fÏ€€"4Data.Text.Rope.length "fÏ€€"37 text-rope text-ropeèSplit at given UTF-16 code unit. If requested number of code units splits a code point in half, return l. Takes linear time.:set -XOverloadedStrings"map (\c -> splitAt c "fÏ€€") [0..4]É[Just ("","fÏ€€"),Just ("f","Ï€€"),Just ("fÏ","€€"),Nothing,Just ("fÏ€€","")]? text-rope&Split at given line, logarithmic time.:set -XOverloadedStrings+map (\l -> splitAtLine l "foo\nbar") [0..3]Á[("","foo\nbar"),("foo\n","bar"),("foo\nbar",""),("foo\nbar","")]@ text-ropeCombination of ? and subsequent >. Time is linear in ) and logarithmic in (.:set -XOverloadedStrings&splitAtPosition (Position 1 0) "f\n€€Ï"Just ("f\n","€€Ï")&splitAtPosition (Position 1 1) "f\n€€Ï"Nothing&splitAtPosition (Position 1 2) "f\n€€Ï"Just ("f\n€€","Ï")&splitAtPosition (Position 0 2) "f\n€€Ï"Just ("f\n","€€Ï")&splitAtPosition (Position 0 3) "f\n€€Ï"Nothing&splitAtPosition (Position 0 4) "f\n€€Ï"Just ("f\n€€","Ï")&'()456789:;<=>?@498=<5:;?6>&'()7@(c) 2021-2022 Andrew LelechenkoBSD3/Andrew Lelechenko None2ÁÂÎÑà8+J text-ropeRope of dÛ chunks with logarithmic concatenation. This rope offers two interfaces: one based on code points and another one based on UTF-16 code units. This comes with a price of double bookkeeping and is less performant than Data.Text.Rope or Data.Text.Utf16.Rope.K text-rope$Check whether a rope is empty, O(1).L text-rope"Length in code points, similar to  Data.Text. , O(1).:set -XOverloadedStringscharLength "fÏ€€"3M text-rope"Length in UTF-16 code units, O(1).:set -XOverloadedStringsutf16Length "fÏ€€"4N text-rope charSplitAt c "fÏ€€") [0..4]8[("","fÏ€€"),("f","Ï€€"),("fÏ","€€"),("fÏ€€",""),("fÏ€€","")]W text-ropeèSplit at given UTF-16 code unit. If requested number of code units splits a code point in half, return l. Takes linear time.:set -XOverloadedStrings'map (\c -> utf16SplitAt c "fÏ€€") [0..4]É[Just ("","fÏ€€"),Just ("f","Ï€€"),Just ("fÏ","€€"),Nothing,Just ("fÏ€€","")]X text-rope&Split at given line, logarithmic time.:set -XOverloadedStrings+map (\l -> splitAtLine l "foo\nbar") [0..3]Á[("","foo\nbar"),("foo\n","bar"),("foo\nbar",""),("foo\nbar","")]Y text-ropeCombination of X and subsequent V. Time is linear in  and logarithmic in .:set -XOverloadedStrings*charSplitAtPosition (Position 1 0) "f\n€€Ï" ("f\n","€€Ï")*charSplitAtPosition (Position 1 1) "f\n€€Ï" ("f\n€€","Ï")*charSplitAtPosition (Position 1 2) "f\n€€Ï" ("f\n€€Ï","")*charSplitAtPosition (Position 0 2) "f\n€€Ï" ("f\n","€€Ï")*charSplitAtPosition (Position 0 3) "f\n€€Ï" ("f\n€€","Ï")*charSplitAtPosition (Position 0 4) "f\n€€Ï" ("f\n€€Ï","")Z text-ropeCombination of X and subsequent W. Time is linear in ) and logarithmic in (.:set -XOverloadedStrings+utf16SplitAtPosition (Position 1 0) "f\n€€Ï"Just ("f\n","€€Ï")+utf16SplitAtPosition (Position 1 1) "f\n€€Ï"Nothing+utf16SplitAtPosition (Position 1 2) "f\n€€Ï"Just ("f\n€€","Ï")+utf16SplitAtPosition (Position 0 2) "f\n€€Ï"Just ("f\n","€€Ï")+utf16SplitAtPosition (Position 0 3) "f\n€€Ï"Nothing+utf16SplitAtPosition (Position 0 4) "f\n€€Ï"Just ("f\n€€","Ï")JKLMNOPQRSTUVWXYZJQPUTKRSXLVNYMWOZí        !"#  $%&'()    !"#*+,- ./01 !"#234%56789:;<=$text-rope-0.2-CGS9EWvlpOR3Yzb6R6SKmKData.Text.LinesData.Text.RopeData.Text.Utf16.LinesData.Text.Utf16.RopeData.Text.Utf16.Rope.MixedData.Text.Lines.InternalRope Data.Listlength Data.TextlinesspansplitAtPositionposLine posColumn TextLinestoTextfromTextnull lengthInLines splitAtLinelengthAsPositionsplitAtPosition fromTextLines toTextLines $fMonoidRope$fSemigroupRope$fIsStringRope $fShowRope $fOrdRope$fEqRope $fNFDataRope $fMonoidLines$fSemigroupLines$fMonoidPosition$fSemigroupPosition$fNFDataPosition $fEqPosition $fOrdPosition$fShowPosition charLength utf16LengthcharLengthAsPositionutf16LengthAsPosition charSplitAt utf16SplitAtcharSplitAtPositionutf16SplitAtPosition text-1.2.3.2Data.Text.InternalText _nlIndices binarySearch intToWord wordToInt textLinesbase GHC.MaybeNothing