repositories
/
fp1415.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1bca891
)
isequal tryouts...
author
Camil Staps
<info@camilstaps.nl>
Thu, 30 Apr 2015 13:46:25 +0000
(15:46 +0200)
committer
Camil Staps
<info@camilstaps.nl>
Thu, 30 Apr 2015 13:46:25 +0000
(15:46 +0200)
fp2/week3/camil/StdDynSet.icl
patch
|
blob
|
history
diff --git
a/fp2/week3/camil/StdDynSet.icl
b/fp2/week3/camil/StdDynSet.icl
index
ef6198d
..
2d3f95a
100644
(file)
--- a/
fp2/week3/camil/StdDynSet.icl
+++ b/
fp2/week3/camil/StdDynSet.icl
@@
-12,6
+12,13
@@
isEqual:: Dynamic t -> Bool | Set t
isEqual (x :: t^) a = x == a
isEqual _ _ = False
isEqual (x :: t^) a = x == a
isEqual _ _ = False
+//isEqual`:: Dynamic Dynamic -> Bool | Set t
+//isEqual` (x :: t^) (y :: t^) = x == y
+//isEqual` _ _ = False
+
+isEqual`` :: Dynamic Dynamic -> Bool
+isEqual`` x y = (fromJust(fromDynamic x)) == (fromJust(fromDynamic y))
+
class Set a | TC, ==, toString a
:: Set = Set [Dynamic]
class Set a | TC, ==, toString a
:: Set = Set [Dynamic]
@@
-57,7
+64,7
@@
union (Set a) (Set b) = Set (a ++ b)
intersection :: Set Set -> Set
intersection (Set []) bs = bs
intersection as (Set []) = as
intersection :: Set Set -> Set
intersection (Set []) bs = bs
intersection as (Set []) = as
-intersection (Set [a:as]) (Set
[(b::t):bs]
) = Set [a \\ a <- as | not (dynMemberOfSet a (Set bs))]
+intersection (Set [a:as]) (Set
bs
) = Set [a \\ a <- as | not (dynMemberOfSet a (Set bs))]
without :: Set Set -> Set
without a b = abort "without nog niet geimplementeerd.\n"
without :: Set Set -> Set
without a b = abort "without nog niet geimplementeerd.\n"