Hi,

suppose there are two (identical) classes:

> class Res a b | a -> b  where
>       getRes :: a -> b

and

> class Res2 t where
>       type Member t
>       getRes2 :: t -> Member t

It is easy to automatically make every instance of Res2 an instance of
res:

> instance Res2 a => Res a (Member a) where
>       getRes x = getRes2 x

However, declaring every instance of Res an instance of Res2 seems
impossible, as the following doesn't compile

> instance Res a b => Res2 a where
>       type Member a = b
>       getRes2 x = getRes x

Question is: How to do this? The reason I need it is because I use a
library which uses functional dependencies, but my classes shall be type
families.

Regards,
Henning

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

Reply via email to