def text.replace.at
import ezsys@0.1.0.0/src/str.bend as Strimport Base
86# a nonempty `old` at this character, or not: write `new` and pass over
87# the rest of `old`, or write the character
88def text.replace.at(
89 hit: Bool,
90 hd: Char,
91 +new: String,
92 +left: Nat,
93 next: Nat -> String
94) -> String:
95 match hit:
96 case True{}:
97 new ++ next(left)
98 case False{}:
99 SCon{hd, next(0n)}