def digits

yaml-for-bend@0.1.1.0 · scan.bend:1245

import yaml-for-bend@0.1.1.0/scan.bend as Scan
import Base

1245def digits(s: String) -> Taken:
1246  match s:
1247    case SNil{}:
1248      Taken{"", 0n}
1249    case SCon{+c, t}:
1250      took.or(Bool.not(Char.is_digit(c)), u => taken.cons(c, 1n, digits(t)))

Uses (6)

Used by (2)