[Haskell-cafe] Re: coherence when overlapping?

Simon Peyton-Jones simonpj at microsoft.com
Thu Apr 13 04:52:47 EDT 2006


| I believe that GHC's overlapping instance extensions
| effectively uses inequalities.

I tried to write down GHC's rules in the manual:
http://haskell.org/ghc/dist/current/docs/users_guide/type-extensions.htm
l#instance-decls

The short summary is:
- find candidate instances that match
- if there is exactly one, choose it
- if the is more than one, choose the best fit UNLESS that choice
	would be changed if a type variable was instantiated


Simon



More information about the Haskell-Cafe mailing list