
jules:
peterv wrote:
instance Vector Vector2 where dot (V2 x1 y1) (V2 x2 y2) = x1 * x2 + y1 * y2
Amazing, so simple it is, Yoda would say ;)
I did not realize one could perform "partial application" on types when declaring instances (I mean not specifying the type of Vector2 in <instance Vector Vector2>).
Now regarding these funcdeps, are they "ill" as the "rumor" goes?
I don't think there is any danger of them being removed and not replaced. The functionality is useful.
Associated Types is widely viewed as a successor/replacement, but no complete implementation exists yet:
I think the implementation is some 90% complete though, in GHC head. Certainly you can write many associated types programs already -- the missing part is finishing off associated type synonyms, iirc. -- Don