Hi Julian

Variations of this one come up quite often, in a nutshell the
typechecker doesn't use the instance context in the way you are
expecting:

> instance (Prelude.Num x) => Num x x x where
           ^^^^^^^^^^^^^^^
           instance context

GHC takes less notice of the context than you might expect. Quite how
much notice it takes I'm finding had to establish from section 7.6 of
the user guide (Section 7.6.3.4. - Overlapping instances - appears to
indicate it might even take none, though maybe my reading is missing
something). Hopefully someone else will provide a definitive answer
soon.


http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/type-class-extensions.html

Best wishes

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

Reply via email to