diff options
| author | Camil Staps | 2015-04-30 15:46:25 +0200 | 
|---|---|---|
| committer | Camil Staps | 2015-04-30 15:46:25 +0200 | 
| commit | 19e299927734dbadd824b18590c3fcc7ba8f6f23 (patch) | |
| tree | d02ae3ead764140187051d4fad1c919ef24fdb63 /fp2/week3/camil | |
| parent | dynset (diff) | |
isequal tryouts...
Diffstat (limited to 'fp2/week3/camil')
| -rw-r--r-- | fp2/week3/camil/StdDynSet.icl | 9 | 
1 files changed, 8 insertions, 1 deletions
| diff --git a/fp2/week3/camil/StdDynSet.icl b/fp2/week3/camil/StdDynSet.icl index ef6198d..2d3f95a 100644 --- 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`:: 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] @@ -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 [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" | 
