diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2011-10-24 08:34:19 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2011-10-24 08:34:19 +0100 |
commit | 8f16b3cddb803c6ff777a82e49efcefc7a32121f (patch) | |
tree | 71091d065c5043dd50eaf45811e1960c2beabeee /docs | |
parent | b653231468f4f166133ca91bc7ca2f5717e5d726 (diff) | |
parent | 50b33e329b3537a28e152ff71417d976443bd7b7 (diff) | |
download | haskell-8f16b3cddb803c6ff777a82e49efcefc7a32121f.tar.gz |
Merge branch 'master' of http://darcs.haskell.org/ghc
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/flags.xml | 4 | ||||
-rw-r--r-- | docs/users_guide/glasgow_exts.xml | 18 |
2 files changed, 19 insertions, 3 deletions
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index 8043834d68..244bbf64a6 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -797,10 +797,10 @@ <entry><option>-XNoTypeFamilies</option></entry> </row> <row> - <entry><option>-XConstraintKind</option></entry> + <entry><option>-XConstraintKinds</option></entry> <entry>Enable a <link linkend="constraint-kind">kind of constraints</link>.</entry> <entry>dynamic</entry> - <entry><option>-XNoConstraintKind</option></entry> + <entry><option>-XNoConstraintKinds</option></entry> </row> <row> <entry><option>-XScopedTypeVariables</option></entry> diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index 1fc904ff6d..6c92f4ff34 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -3568,6 +3568,22 @@ Here, <literal>C</literal> is a superclass of <literal>D</literal>, but it's OK class operation <literal>op</literal> of <literal>C</literal> to mention <literal>D</literal>. (It would not be OK for <literal>D</literal> to be a superclass of <literal>C</literal>.) </para> +<para> +With the extension that adds a <link linkend="constraint-kind">kind of constraints</link>, +you can write more exotic superclass definitions. The superclass cycle check is even more +liberal in these case. For example, this is OK: + +<programlisting> + class A cls c where + meth :: cls c => c -> c + + class A B c => B c where +</programlisting> + +A superclass context for a class <literal>C</literal> is allowed if, after expanding +type synonyms to their right-hand-sides, and uses of classes (other than <literal>C</literal>) +to their superclasses, <literal>C</literal> does not occur syntactically in the context. +</para> </sect3> @@ -5189,7 +5205,7 @@ class (F a ~ b) => C a b where </para> <para> - With the <option>-XConstraintKind</option> flag, GHC becomes more liberal in + With the <option>-XConstraintKinds</option> flag, GHC becomes more liberal in what it accepts as constraints in your program. To be precise, with this flag any <emphasis>type</emphasis> of the new kind <literal>Constraint</literal> can be used as a constraint. The following things have kind <literal>Constraint</literal>: |