numbers: ParseCharResult refactor

This commit is contained in:
Nathan McCarty 2025-01-26 20:51:10 -05:00
parent b1a4e1a941
commit 40251a1455

View file

@ -63,7 +63,7 @@ nat b = do
where
parseDigit : Parser Nat
parseDigit = do
GotChar char <- parseChar (hasDigit b) id
GotChar char <- parseChar (hasDigit b)
| GotError e => throwParseError "\{show e} is not a digit"
| EndOfInput => throwParseError "End Of Input"
case digitValue b char of
@ -120,7 +120,7 @@ double = do
where
parseDigit : Parser Char
parseDigit = do
GotChar char <- parseChar (hasDigit base10) id
GotChar char <- parseChar (hasDigit base10)
| GotError e => throwParseError "\{show e} is not a digit"
| EndOfInput => throwParseError "End Of Input"
pure char