Is Parsec's ParserError missing an Eq instance

Greg Fitzgerald garious at gmail.com
Wed Sep 10 20:21:16 EDT 2008


Hi Manuel,

> Is Parsec's ParserError missing an Eq instance
> What is the recommended way to use HUnit to test Parsec parsers?

In my project, I implemented Eq for ParseError locally.


{-# OPTIONS_GHC -fno-warn-orphans #-}

import Text.ParserCombinators.Parsec.Error(ParseError, Message,
errorMessages, messageEq)

instance Eq ParseError where
   a == b = errorMessages a == errorMessages b

instance Eq Message where
   (==) = messageEq


I don't know if it was intentionally left out or not.  You might get more
responses on Haskell-Cafe.

-Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/libraries/attachments/20080910/0ffcda77/attachment.htm


More information about the Libraries mailing list