Commit ea53d9c2 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Document overlapping instances more clearly

parent 04abb495
......@@ -4397,6 +4397,12 @@ The constraint <literal>C Int [Int]</literal> matches instances (A),
most-specific match, the program is rejected.
</para>
<para>
An instance declaration is <emphasis>more specific</emphasis> than another iff
the head of former is a substitution instance of the latter. For example
(D) is "more specific" than (C) because you can get from (C) to (D) by
substituting <literal>a:=Int</literal>.
</para>
<para>
However, GHC is conservative about committing to an overlapping instance. For example:
<programlisting>
f :: [b] -> [b]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment