
8 Jan
2009
8 Jan
'09
12:26 p.m.
Hi Jeff, Jeff Heard wrote:
instance Region a => Eq a where regiona == regionb = all $ zipWith (==) (bounds regiona) (bounds regionb)
If you want to be Haskell98 compliant, why not define regionEquals :: Region a => a -> a -> Bool as above and use that everywhere instead of (==)? If you insist on using the overloaded (==), then in Haskell98 you will need to define individual Eq instances for all your custom region types. However, you can simply define (==) = regionEquals for all those types. Hope this helps, Martijn.