[project @ 2003-12-16 16:54:42 by simonmar]
authorsimonmar <unknown>
Tue, 16 Dec 2003 16:54:42 +0000 (16:54 +0000)
committersimonmar <unknown>
Tue, 16 Dec 2003 16:54:42 +0000 (16:54 +0000)
Add Show instance for Set

Data/Set.hs

index 3e46e2c..3c81002 100644 (file)
@@ -92,6 +92,9 @@ instance (Eq a) => Eq (Set a) where
   (MkSet set_1) == (MkSet set_2) = set_1 == set_2
   (MkSet set_1) /= (MkSet set_2) = set_1 /= set_2
 
+instance Show e => Show (Set e) where
+  showsPrec p s = showsPrec p (setToList s)
+
 -- but not so clear what the right thing to do is:
 {- NO:
 instance (Ord a) => Ord (Set a) where