def nat_ok
import bolt@1.27.0.0/src/rules/tokens.bend as Tokensimport Base
import bolt@1.27.0.0/src/lazy/lazy.bend as Lazy
57# digits, then one final `n`: a Nat literal's chars
58def nat_ok(cs: List<&2, Char>) -> Bool:
59 match cs:
60 case Con{'n', Nil{}}:
61 True{}
62 case Con{+c, t}:
63 Lazy.and_then(Char.is_digit(c), _u => nat_ok(t))
64 case Nil{}:
65 False{}