Browse files

adding new practice - on type classes

  • Loading branch information...
1 parent 4da0421 commit 1120bd3d2fa88f348479d8aae46064876e86c94b @robertaarcoverde committed Oct 12, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 type_classes.hs
View
11 type_classes.hs
@@ -0,0 +1,11 @@
+{------------------------------------------------------------------------------
+
+Type Classes - Defining Set
+
+------------------------------------------------------------------------------}
+
+data Set a = Set [a]
+
+instance Eq a => Eq Set a where
+ Set [] == Set [] = True
+ Set (x:xs) == Set (y:ys) = x == y && (xs == ys)

0 comments on commit 1120bd3

Please sign in to comment.