def count

bend-kit-bytes@0.3.3.0 · bytes.bend:290

import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import 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))

Uses (3)

Used by (13)