numbers: ParseCharResult refactor
This commit is contained in:
parent
b1a4e1a941
commit
40251a1455
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue