[Haskell-cafe] Ambiguous reified dictionaries

Jules Bean jules at jellybean.co.uk
Wed Apr 15 07:49:19 EDT 2009

Simon Peyton-Jones wrote:
 > Yes, Haskell says that in any program there should be only one
 > instance for any particular type (here Monoid Int).  GHC
 > doesn't check that, but it should really do so.  It's not
 > necessary for soundness (ie no runtime crash) but it is
 > necessary for coherence (ie when you run the program the answer
 > you get doesn't depend on which dictionary the typechecker
 > arbitrarily chose).

Unless of course, your program implicitly depends on the coherence of 
dictionary choice for its own soundness, for example, a program using 
Data.Typeable to implement Dynamic or similar.


More information about the Haskell-Cafe mailing list