summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-10-31 17:03:28 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2012-10-31 17:03:28 +0000
commit232f1a2702684fe7f82a084213714adfa6162392 (patch)
tree23e445bcf68300a8e53c0d878a1e0da2bba2e7de /docs
parent33d0f4992bb2340e4a7abb2c5eb92c2672d844dd (diff)
downloadhaskell-232f1a2702684fe7f82a084213714adfa6162392.tar.gz
Add notes about type-family overlap in GHCi (see Trac #7102)
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/ghci.xml6
-rw-r--r--docs/users_guide/glasgow_exts.xml1
2 files changed, 6 insertions, 1 deletions
diff --git a/docs/users_guide/ghci.xml b/docs/users_guide/ghci.xml
index 94be422c91..3d1aecc2fb 100644
--- a/docs/users_guide/ghci.xml
+++ b/docs/users_guide/ghci.xml
@@ -614,7 +614,7 @@ Prelude>
<sect2 id="ghci-decls">
<title>Type, class and other declarations</title>
- <para>[<emphasis role="bold">New in version 7.4.1</emphasis>] At the GHCi
+ <para>At the GHCi
prompt you can also enter any top-level Haskell declaration,
including <literal>data</literal>, <literal>type</literal>, <literal>newtype</literal>, <literal>class</literal>, <literal>instance</literal>, <literal>deriving</literal>,
and <literal>foreign</literal> declarations. For
@@ -662,6 +662,10 @@ Prelude>
an attempt to distinguish it from the new <literal>T</literal>,
which is displayed as simply <literal>T</literal>.</para>
+ <para>Class and type-family instance declarations are simply added to the list of available isntances, with one
+ exception. Since type-family instances are not permitted to overlap, but you might want to re-define one,
+ a type-family instance <emphasis>replaces</emphasis> any earlier type instance with an identical left hand side.
+ (See <xref linkend="type-families"/>.)</para>
</sect2>
<sect2 id="ghci-scope">
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index b03667472f..fa0f3aa4e2 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -4891,6 +4891,7 @@ type instance G (a, Int) = [a]
type instance G (Char, a) = [a] -- ILLEGAL overlap, as [Char] /= [Int]
</programlisting>
</para>
+ <para> However see <xref linkend="ghci-decls"/> for the overlap rules in GHCi.</para>
</sect3>
<sect3 id="type-family-decidability">