def nat.go

emerging-ezjson@1.3.0.0 · src/fixed.bend:94

import emerging-ezjson@1.3.0.0/src/fixed.bend as Fixed
import Base

94# decimal digits read onto acc, most significant first
95def nat.go(txt: String, acc: Nat) -> Nat:
96  match txt:
97    case SNil{}:
98      acc
99    case SCon{hd, tl}:
100      nat.go(tl, Nat.add(Nat.mul(acc, 10n), digit.nat(hd)))

Uses (5)

Used by (1)