def count
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytesimport Base
290# String.length counts in Nat, which costs more than the walk itself.
291def count(s: String, +n: U32) -> U32:
292 match s:
293 case SNil{}:
294 n
295 case SCon{c, t}:
296 count(t, (n + 1 : U32))