def decimal_digits

cli@0.2.0.0 · cli.bend:1923

import cli@0.2.0.0/cli.bend as Cli
import Base

1923# Decimal digits by Nat.read's own test, which Char.is_digit agrees with.
1924def decimal_digits(s: String) -> Bool:
1925  match s:
1926    case SNil{}: True{}
1927    case SCon{Chr{x}, tail}:
1928      Bool.and(U32.is_lt(U32.sub(x, 48), 10), decimal_digits(tail))

Uses (6)

Used by (1)