From ff7467962f4da6ffbe5fe94d464d38b7ce862910 Mon Sep 17 00:00:00 2001 From: ross Date: Thu, 22 May 2003 08:21:49 +0000 Subject: [PATCH] [project @ 2003-05-22 08:21:49 by ross] add Eq instance (explicit, so Haddock won't be confused) --- Data/Tree.hs | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 1.7.10.4