Is there any way in Haskell to have the correct function selected
based on the types of two different types? For example, let's say I'm
writing intersection tests:

aABBandAABB :: AABB -> AABB -> Bool
oBBandOBB :: OBB -> OBB -> Bool
oBBandPoint :: OBB -> Point -> Bool

Is there some way (such as with Type Families) that I can write some
sort of generic method for this:

intersects :: Intersectable -> Intersectable -> Bool

which automatically selects the right function to call based on the
types of the two intersectables?

Regards,
  - clark

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to