From: ross Date: Thu, 22 May 2003 08:21:49 +0000 (+0000) Subject: [project @ 2003-05-22 08:21:49 by ross] X-Git-Tag: nhc98-1-18-release~641 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ff7467962f4da6ffbe5fe94d464d38b7ce862910;p=ghc-base.git [project @ 2003-05-22 08:21:49 by ross] add Eq instance (explicit, so Haddock won't be confused) --- diff --git a/Data/Tree.hs b/Data/Tree.hs index 763afa7..ac046d9 100644 --- a/Data/Tree.hs +++ b/Data/Tree.hs @@ -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