def text.split.at
import ezsys@0.1.0.0/src/str.bend as Strimport Base
146# a separator at this character ends a piece; else the character starts it
147def text.split.at(
148 hit: Bool,
149 hd: Char,
150 +left: Nat,
151 next: Nat -> List<&2, String>
152) -> List<&2, String>:
153 match hit:
154 case True{}:
155 SNil{} <> next(left)
156 case False{}:
157 text.split.push(hd, next(0n))