FYI, Data.Map uses an Ord instance for keys, not an Eq instance.
> alter its Eq => definition
module MatchTuple (MyP) where
data MyP t = MyP(t,t) deriving Show
instance Eq t => Eq (MyP t) where
(==) = match
match::Eq t => MyP t-> MyP t -> Bool
match (MyP(x1,x2)) (MyP(x3,x4))
| x1 == x3 && x2 == x4 = True
| x1 == x4 && x2 == x3 = True
| otherwise = False
?
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners