[project @ 2003-05-22 08:21:49 by ross]
authorross <unknown>
Thu, 22 May 2003 08:21:49 +0000 (08:21 +0000)
committerross <unknown>
Thu, 22 May 2003 08:21:49 +0000 (08:21 +0000)
add Eq instance (explicit, so Haddock won't be confused)

Data/Tree.hs

index 763afa7..ac046d9 100644 (file)
@@ -29,6 +29,10 @@ instance Functor Tree where
 mapTree              :: (a -> b) -> (Tree a -> Tree b)
 mapTree f (Node x ts) = Node (f x) (map (mapTree f) ts)
 
+-- explicit instance for Haddock's benefit
+instance Eq a => Eq (Tree a) where
+  Node x ts == Node x' ts'  =  x == x' && ts == ts'
+
 instance Show a => Show (Tree a) where
   show = showTree
   showList ts s = showForest ts ++ s