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


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

Reply via email to