
18 Sep
2013
18 Sep
'13
8:21 a.m.
Could someone please explain what the difference (if any!), in semantics is between class Foo f => Bar f g where method1 :: f a -> g a and class Bar' g where method2 :: Foo f => f a -> g a ? Maybe the translation of the above to something lower level might help. [Note: "f a -> g a" is just an example, and is not meaningful to the question]. The best answer would contain a design guideline for typeclasses, which would spell out conditions in which to use each variant. Jacques