Skip to content

Commit afdd5f0

Browse files
committed
Parented ParseError instance.
1 parent 5fe12d6 commit afdd5f0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Text/Parsing/Parser.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ instance errorParseError :: Error ParseError where
2727
noMsg = ParseError { message: "" }
2828
strMsg msg = ParseError { message: msg }
2929

30+
instance showParseError :: Show ParseError where
31+
show (ParseError msg) = "ParseError { message: " ++ msg.message ++ " }"
32+
3033
newtype ParserT s m a = ParserT (s -> m { input :: s, result :: Either ParseError a, consumed :: Boolean })
3134

3235
unParserT :: forall m s a. ParserT s m a -> s -> m { input :: s, result :: Either ParseError a, consumed :: Boolean }

src/Text/Parsing/Parser/Combinators.purs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,6 @@ lookAhead (ParserT p) = ParserT \s -> do
120120
state <- p s
121121
return state{input = s, consumed = false}
122122

123-
instance showParseError :: Show ParseError where
124-
show (ParseError msg) = msg.message
125-
126123
manyTill :: forall s a m e. (Monad m) => ParserT s m a -> ParserT s m e -> ParserT s m [a]
127124
manyTill p end = scan
128125
where

0 commit comments

Comments
 (0)