BendLintRules.apply.go: def of bend-lint-rules@0.2.0.0 Import: import bend-lint-rules@0.2.0.0/lib/text/main.bend as BendLintRules Lines 25-37 of bend-lint-rules@0.2.0.0/lib/text/main.bend: https://jend.leeeet.dev/read.txt?path=bend-lint-rules@0.2.0.0/lib/text/main.bend&start_line=25&end_line=37 import Base import bend-lint-api@0.2.0.0/shared/strings.bend as Strings # `rest`, the text from `at` on, with `edits` (in order) made, after the pieces of `out` (last first). The pieces join # once, at the end, so the text is copied once, whatever the number of edits. def apply.go(edits: List<&2, Edit>, +rest: String, +at: U32, out: List<&2, String>) -> String: match edits: case Nil{}: Strings.onto(rest <> out, "") case Con{Edit{p, beg, +end, text}, more}: apply.go( more, String.drop(rest, U32.to_nat((end - at: U32))), end, text <> Strings.take(rest, U32.to_nat((beg - at: U32))) <> out ) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.drop https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/shared/strings.bend&name=onto https://jend.leeeet.dev/definition.txt?path=bend-lint-api@0.2.0.0/shared/strings.bend&name=take https://jend.leeeet.dev/definition.txt?path=bend-lint-rules@0.2.0.0/lib/text/main.bend&name=Edit