[commit: ghc] overlapping-tyfams: Checkpoint on user manual. (7cbde84)
Richard Eisenberg
eir at cis.upenn.edu
Fri Jun 21 15:17:26 CEST 2013
Repository : http://darcs.haskell.org/ghc.git/
On branch : overlapping-tyfams
https://github.com/ghc/ghc/commit/7cbde847ee319dc1deca42c191f708c44fbc4429
>---------------------------------------------------------------
commit 7cbde847ee319dc1deca42c191f708c44fbc4429
Author: Richard Eisenberg <eir at cis.upenn.edu>
Date: Thu Jun 20 23:38:49 2013 +0100
Checkpoint on user manual.
>---------------------------------------------------------------
docs/users_guide/glasgow_exts.xml | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index fb9574c..75a2c68 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -5258,7 +5258,16 @@ type instance G (Char, a) = [a] -- ILLEGAL overlap, as [Char] /= [Int]
in turn relies on type family reduction. This condition of "apartness", as
stated, is impossible to check, so we use this conservative approximation:
two types are considered to be apart when the two types cannot be unified,
- even by a potentially infinite unifier.
+ even by a potentially infinite unifier. Allowing the unifier to be infinite
+ disallows the following pair of instances:
+<programlisting>
+type instance H x x = Int
+type instance H [x] x = Bool
+</programlisting>
+ The type patterns in this pair equal if <literal>x</literal> is replaced
+ by an infinite nesting of lists. Rejecting instances such as these is
+ necessary for type soundness.
+ </para>
<para> However see <xref linkend="ghci-decls"/> for the overlap rules in GHCi.</para>
</sect3>
More information about the ghc-commits
mailing list