[Haskell-cafe] Functional dependencies *not* part of the next Haskell standard?

Jules Bean jules at jellybean.co.uk
Thu Jul 12 09:08:36 EDT 2007


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:

http://haskell.org/haskellwiki/GHC/Indexed_types

I'm sure FDs are here for a while yet.

Jules


More information about the Haskell-Cafe mailing list