Cli.valid_nat: def of cli@0.2.0.0 Import: import cli@0.2.0.0/cli.bend as Cli Lines 1930-1934 of cli@0.2.0.0/cli.bend: https://jend.leeeet.dev/read.txt?path=cli@0.2.0.0/cli.bend&start_line=1930&end_line=1934 import Base # A Nat value is what Nat.read reads (P22): digits that, less leading # zeroes, fit under its cap of 2^48-1. def valid_nat(+s: String) -> Bool: Bool.and(Bool.not(String.is_empty(s)), Bool.and(decimal_digits(s), Nat.read.fits(Nat.read.trim(s)))) Uses (8): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.read.fits https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.read.trim https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.is_empty https://jend.leeeet.dev/definition.txt?path=cli@0.2.0.0/cli.bend&name=decimal_digits