Hello Mark,

Thursday, January 10, 2008, 4:25:20 PM, you wrote:

"instance Num a =>> A a"

> Mean the same thing as

> "instance A (forall a.Num a=>a)"

programmers going from OOP world always forget that classes in Haskell
doesn't the same as classes in C++. *implementation* of this instance
require to pass dictionary of Num class along with type. now imagine
the following code:

f :: A a => a -> a

f cannot use your instance because it doesn't receive Num dictionary
of type `a`. it is unlike OOP situation where every object carries the
generic VMT which includes methods for every class/interface that
object supports

as usual, i suggest you to study 
http://haskell.org/haskellwiki/OOP_vs_type_classes
first and especially two papers mentioned in References there

-- 
Best regards,
 Bulat                            mailto:[EMAIL PROTECTED]

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

Reply via email to