def valid_nat

cli@0.2.0.0 · cli.bend:1930

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

1930# A Nat value is what Nat.read reads (P22): digits that, less leading
1931# zeroes, fit under its cap of 2^48-1.
1932def valid_nat(+s: String) -> Bool:
1933  Bool.and(Bool.not(String.is_empty(s)),
1934    Bool.and(decimal_digits(s), Nat.read.fits(Nat.read.trim(s))))

Uses (8)

Used by (2)