Skip to content

Commit a30a12f

Browse files
committed
Eq instance for ParseError
1 parent cd65474 commit a30a12f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Text/Parsing/Parser.purs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ data ParseError = ParseError
2525
instance showParseError :: Show ParseError where
2626
show (ParseError msg) = "ParseError { message: " ++ msg.message ++ ", position: " ++ show msg.position ++ " }"
2727

28+
instance eqParseError :: Eq ParseError where
29+
eq (ParseError {message : m1, position : p1}) (ParseError {message : m2, position : p2}) = m1 == m2 && p1 == p2
30+
2831
-- | `PState` contains the remaining input and current position.
2932
data PState s = PState
3033
{ input :: s

0 commit comments

Comments
 (0)