Skip to content

Commit

Permalink
adding new practice - on type classes
Browse files Browse the repository at this point in the history
  • Loading branch information
rla4 committed Oct 12, 2011
1 parent 4da0421 commit 1120bd3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions 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.