GHC 6.6 Data.Tuple incompatibility

John Goerzen jgoerzen at complete.org
Thu Oct 19 15:21:37 EDT 2006


Hello,

I had this code that worked in GHC 6.4:

type CommandHandler = FTPServer -> String -> IO Bool
type Command = (String, (CommandHandler, (String, String)))

instance Eq Command where
    x == y = (fst x) == (fst y)
instance Ord Command where
    compare x y = compare (fst x) (fst y)

I am compiling with overlapping instances set.

In GHC 6.6, this gives an error that Eq Command is a duplicate instance
of one defined in Data.Tuple.  Commenting out that instance causes the
Ord Command instance to fail because there is no Eq instance for
CommandHandler.

After discussing it with Ian Lynagh, his conclusion was that the problem
is that Data.Tuple was not compiled with overlapping instances support,
and that it probably ought to be.  He asked me to post here to see if
everyone else felt the same way.

Thanks,

-- John


More information about the Libraries mailing list