[commit: ghc] master: Add notes about type-family overlap in GHCi (see Trac #7102) (232f1a2)

Simon Peyton Jones <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/232f1a2702684fe7f82a084213714adfa6162392

>---------------------------------------------------------------

commit 232f1a2702684fe7f82a084213714adfa6162392
Author: Simon Peyton Jones <[email protected]>
Date:   Wed Oct 31 17:03:28 2012 +0000

    Add notes about type-family overlap in GHCi (see Trac #7102)

>---------------------------------------------------------------

 docs/users_guide/ghci.xml         |    6 +++++-
 docs/users_guide/glasgow_exts.xml |    1 +
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/docs/users_guide/ghci.xml b/docs/users_guide/ghci.xml
index 94be422..3d1aecc 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 b036674..fa0f3aa 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">
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.