1 implementation module StdDynSet
6 class Set a | TC, ==, toString a
14 where toString (Set a) = abort "toString not implemented"
18 (==) (Set []) (Set []) = True
19 (==) (Set []) _ = False
20 (==) _ (Set []) = False
22 toSet :: a -> Set | Set a
23 toSet a = Set [dynamic a]
25 nrOfElts :: Set -> Int
26 nrOfElts (Set a) = length a
28 isEmptySet :: Set -> Bool
29 isEmptySet (Set []) = True
32 memberOfSet :: a Set -> Bool | Set a
33 memberOfSet _ (Set []) = False
34 memberOfSet x (Set [y:xs])
36 | otherwise = memberOfSet x xs
38 isSubset :: Set Set -> Bool
39 isSubset a b = abort "isSubset nog niet geimplementeerd.\n"
41 isStrictSubset :: Set Set -> Bool
42 isStrictSubset a b = abort "isStrictSubset nog niet geimplementeerd.\n"
44 union :: Set Set -> Set
45 union a b = abort "union nog niet geimplementeerd.\n"
47 intersection :: Set Set -> Set
48 intersection a b = abort "intersection nog niet geimplementeerd.\n"
50 without :: Set Set -> Set
51 without a b = abort "without nog niet geimplementeerd.\n"