
18 Dec
2007
18 Dec
'07
7:24 a.m.
On Dec 18, 2007 7:51 AM, Jules Bean
class Shape a where { intersect :: Shape b => a -> b -> Bool }
Shouldn't this be class Shape a where ....whatever.... class (Shape a, Shape b) => Intersectable a b where intersect :: a -> b -> Bool With your definition I don't see how you could make it work, as you would have to write a function that takes care of this shape intersecting with any other shape, but this is exactly the problem the classes should solve! Cheers, -- Felipe.