def pt.go

bendonnect-rpc@0.1.0.0 · src/protocol.bend:211

import bendonnect-rpc@0.1.0.0/src/protocol.bend as Protocol
import Base

211def pt.go(s: String, +n: U32, +acc: U32) -> Maybe<&2, U32>:
212  match s:
213    case SNil{}:
214      Some{acc}
215    case SCon{Chr{+c}, t}:
216      pt.pick(Bool.and(digit(c), U32.is_lt(n, 10)), u => pt.go(t, (n + 1 : U32), sat(acc, (c - 48 : U32))))

Uses (11)

Used by (1)