[Haskell-cafe] Re: coherence when overlapping?

william kim haskelllist at hotmail.com
Thu Apr 13 05:30:43 EDT 2006

Thank you Martin.

>Coherence (roughly) means that the program's semantics is independent
>of the program's typing.
>In case of your example below, I could type the program
>either use the first or the second instance (assuming
>g has type Int->Int). That's clearly bound.

If g has type Int->Int, it is not hard to say the first instance should 
But how about g having a polymorphic type? In this case it seems to me 
choosing the second instance is an acceptable choice as that is the only 
applicable one at the moment. What is the definition of a "coherent" 
behaviour here? Or is there one?

>Non-overlapping instances are necessary but not sufficient to
>obtain coherence. We also need that types/programs are unambiguous.

Do you therefore imply that coherence is not defined without the 
non-overlapping assumption?


Get MSN Hotmail alerts on your mobile. 

More information about the Haskell-Cafe mailing list