diff --git a/src/GenericParser/Parser.purs b/src/GenericParser/Parser.purs index 37ee244..2c1a604 100644 --- a/src/GenericParser/Parser.purs +++ b/src/GenericParser/Parser.purs @@ -121,8 +121,10 @@ try p = Parser p' _ -> failureError position error sat :: forall e. (Char -> Boolean) -> Parser e Char -sat p = do x <- item - if p x then pure x else empty +sat p = do + pos <- current_position + x <- item + if p x then pure x else Parser \input -> failure pos digit :: forall e. Parser e Char digit = sat isDigit