Skip to content

Commit 608ba66

Browse files
committed
Merge pull request #23 from epost/improve-error
Report offending char in error message.
2 parents d19f312 + 552d2a2 commit 608ba66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Text/Parsing/Parser/String.purs

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ satisfy :: forall m. (Monad m) => (Char -> Boolean) -> ParserT String m Char
4848
satisfy f = try do
4949
c <- anyChar
5050
if f c then return c
51-
else fail "Character did not satisfy predicate"
51+
else fail $ "Character '" ++ fromChar c ++ "' did not satisfy predicate"
5252

5353
-- | Match the specified character
5454
char :: forall m. (Monad m) => Char -> ParserT String m Char
@@ -67,7 +67,7 @@ skipSpaces = do
6767
return unit
6868

6969
-- | Match one of the characters in the array.
70-
oneOf :: forall s m a. (Monad m) => Array Char -> ParserT String m Char
70+
oneOf :: forall m. (Monad m) => Array Char -> ParserT String m Char
7171
oneOf ss = satisfy (flip elem ss)
7272

7373
-- | Match any character not in the array.

0 commit comments

Comments
 (0)