-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Exercise 6
(@@) :: 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)
The call of sort is missing
Metadata
Metadata
Assignees
Labels
No labels