def nat_value

bolt@1.27.0.0 · src/rules/tokens.bend:81

import bolt@1.27.0.0/src/rules/tokens.bend as Tokens
import Base

81# a Nat literal's value (`12n` is 12); none for anything else or past U32
82def nat_value(+tt: String) -> Maybe<&2, U32>:
83  Bool.pick(Maybe<&2, U32>, nat_ok(String.to_list(tt)), U32.read(stem(tt)), None{})

Uses (8)

Used by (1)