[commit: ghc] wip/redundant-constraints: User manual wibble (357c3ac)

git at git.haskell.org git at git.haskell.org
Mon Jan 5 15:01:35 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/redundant-constraints
Link       : http://ghc.haskell.org/trac/ghc/changeset/357c3acef26e44d8e90b6f4f2520da4bcbfa877d/ghc

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

commit 357c3acef26e44d8e90b6f4f2520da4bcbfa877d
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Jan 5 13:21:31 2015 +0000

    User manual wibble


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

357c3acef26e44d8e90b6f4f2520da4bcbfa877d
 docs/users_guide/using.xml | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml
index 3059cff..88dbdb7 100644
--- a/docs/users_guide/using.xml
+++ b/docs/users_guide/using.xml
@@ -1408,6 +1408,38 @@ foreign import "&f" f :: FunPtr t
           The warning will indicate the duplicated <literal>Eq a</literal> constraint.
           </para>
 
+          <para>This option is now deprecated in favour of <option>-fwarn-redundant-constraints</option>.</para>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><option>-fwarn-redundant-constraints</option>:</term>
+        <listitem>
+          <indexterm><primary><option>-fwarn-redundant-constraints</option></primary></indexterm>
+          <indexterm><primary>redundant constraints, warning</primary></indexterm>
+
+          <para>Have the compiler warn about redundant constraints in a type signature. For
+          example
+          <itemizedlist>
+          <listitem><para>
+          <programlisting>
+             f :: (Eq a, Ord a) => a -> a
+          </programlisting>
+          The warning will indicate the redundant <literal>Eq a</literal> constraint:
+          it is subsumed by the <literal>Ord a</literal> constraint.
+          </para></listitem>
+          <listitem><para>
+          <programlisting>
+             f :: Eq a => a -> a -> Bool
+             f x y = True
+          </programlisting>
+          The warning will indicate the redundant <literal>Eq a</literal> constraint:
+          : it is not used by the definition of <literal>f</literal>.)
+          </para></listitem>
+          </itemizedlist>
+          Similar warnings are given for a redundant constraint in an instance declaration.
+          </para>
+
           <para>This option is on by default.</para>
         </listitem>
       </varlistentry>



More information about the ghc-commits mailing list