testIntersection :: Set Int -> Set Int -> Bool
testIntersection = checkProperties [propOnlyNotInLeftSet, propNotOnlyInLeftSet, propOnlyNotInRightSet, propNotOnlyInRightSet, propInBothSets] setIntersection
testUnion :: Set Int -> Set Int -> Bool
testUnion = checkProperties [propOnlyInLeftSet, propOnlyNotInLeftSet, propOnlyInRightSet, propOnlyNotInRightSet, propInBothSets] setUnion
testDifference :: Set Int -> Set Int -> Bool
testDifference = checkProperties [propOnlyInLeftSet, propNotOnlyNotInLeftSet, propNotOnlyNotInRightSet, propNotInBothSets] setDifference
Nice original code!
Ex 6
trClos :: Ord a => Rel a -> Rel a
trClos clos
| clos == x = sort clos
| otherwise = trClos x
where x = nub $ clos ++ (clos @@ clos)
This will work but does a step too much. Nicer:
trClos :: Ord a => Rel a -> Rel a
trClos clos
| clos == x = sort clos
| otherwise = trClos x
where x = (sort.nub) $ clos ++ (clos @@ clos)
Ex. 3
Nice original code!
Ex 6
This will work but does a step too much. Nicer: