On Dec 18, 2007 7:51 AM, Jules Bean <[EMAIL PROTECTED]> wrote:
> 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.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to