[Haskell-cafe] duplicate instance declarations. Why?

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Oct 24 05:40:40 EDT 2008


Hello Alberto,

Friday, October 24, 2008, 12:20:39 PM, you wrote:

 >>instance  R a => A a
 >>instance S a => A a 
>   
>  Duplicate instance declarations
>  Why?

because you may write in other module

instance R Int
instance S Int

if class A includes functions, it may be problematic to determine
which implementation (via R or via S) to use


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list