You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
crossCheckEls :: Ord a => Set a -> Set a -> Bool
crossCheckEls set1 set2 = subSet setIntersection set1 && subSet setIntersection set2
where
setIntersection = intersectionSet set1 set2
must be changed in
testIntersectionSet :: Ord a => Set a -> Set a -> Bool
testIntersectionSet set1 set2 = subSet setIntersection set1 && subSet setIntersection set2
where
setIntersection = intersectionSet set1 set2
Exercise 5
crossCheckEls is not needed.
Exercise 5
-- Generates a list of tuples and their inverse to make in symmetrical, then
-- sorts that lits and removes any duplicates.
symClos :: Ord a => Rel a -> Rel a
symClos [] = []
symClos (x:xs) = sort( nub( swap x : x : symClos xs))
is too expensive.
Better
symClos' :: Ord a => Rel a -> Rel a
symClos' [] = []
symClos' (ls@x:xs) = (swap x) : ls
symClos :: Ord a => Rel a -> Rel a
symClos xs = sort( nub(symClos' xs))
The text was updated successfully, but these errors were encountered:
Exercise 3
must be changed in
crossCheckEls
is not needed.Exercise 5
is too expensive.
Better
The text was updated successfully, but these errors were encountered: