def text.find
import ezsys@0.1.0.0/src/str.bend as Strimport Base
207# the index, in code points, of the first place the needle starts
208def text.find(txt: String, +needle: String) -> Maybe<&2, U32>:
209 match txt:
210 case SNil{}:
211 text.find.end(needle)
212 case SCon{+h, +t}:
213 text.find.at(String.starts_with(SCon{h, t}, needle),
214 _u => text.find(t, needle))