(@@) :: Eq a => Rel a -> Rel a -> Rel a
(Set r) @@ (Set s) = Set $ nub [ (x,z) | (x,y) <- r, (w,z) <- s, y == w ]
is wrong. Must be
(@@) :: Eq a => Rel a -> Rel a -> Rel a
(Set r) @@ (Set s) = Set $ sort.nub [ (x,z) | (x,y) <- r, (w,z) <- s, y == w ]
This error makes also this definition wrong
trClos :: Ord a => Rel a -> Rel a
trClos set = apprx [foldl1 unionSet (take n rs) | n <- [1..]]
where rs = iterate (set @@) set
apprx (x:y:zs) = if x == y then x else apprx (y:zs)
Exercise 6
is wrong. Must be
This error makes also this definition wrong
The call of
sort
is missing