[commit: ghc] ghc-7.10: #9957: fix docs for unticked promoted constructor warning (4baf8d2)

git at git.haskell.org git at git.haskell.org
Mon Jan 19 14:21:02 UTC 2015


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

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/4baf8d2aa09bb72ff8ba32335ddf235f5a644717/ghc

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

commit 4baf8d2aa09bb72ff8ba32335ddf235f5a644717
Author: Austin Seipp <aseipp at pobox.com>
Date:   Mon Jan 19 08:22:04 2015 -0600

    #9957: fix docs for unticked promoted constructor warning
    
    Signed-off-by: Austin Seipp <aseipp at pobox.com>


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

4baf8d2aa09bb72ff8ba32335ddf235f5a644717
 docs/users_guide/7.10.1-notes.xml | 20 ++++++++++++++++++++
 docs/users_guide/using.xml        |  2 +-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/docs/users_guide/7.10.1-notes.xml b/docs/users_guide/7.10.1-notes.xml
index 318e77e..9ef8d28 100644
--- a/docs/users_guide/7.10.1-notes.xml
+++ b/docs/users_guide/7.10.1-notes.xml
@@ -199,6 +199,26 @@
            </listitem>
            <listitem>
              <para>
+               A new warning flag, <option>-fwarn-unticked-promoted-constructors</option>
+               has been added. This flag causes GHC to warn when you use a promoted constructor without using a "tick" preceding its name.
+             </para>
+             <para>For example:
+             </para>
+<programlisting>
+data Nat = Succ Nat | Zero
+
+data Vec n s where
+  Nil  :: Vec Zero a
+  Cons :: a -> Vec n a -> Vec (Succ n) a
+</programlisting>
+               <para> Will raise two warnings because <function>Zero</function>
+               and <function>Succ</function> are not written as <function>'Zero</function> and
+               <function>'Succ</function>.
+               </para>
+             <para>This warning is enabled by default in <literal>-Wall</literal> mode.</para>
+           </listitem>
+           <listitem>
+             <para>
                Added the option <option>-dth-dec-file</option>.
 
                This dumps out a .th.hs file of all Template Haskell
diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml
index 83c69ce..c1a5196 100644
--- a/docs/users_guide/using.xml
+++ b/docs/users_guide/using.xml
@@ -1815,7 +1815,7 @@ data Vec n s where
             and <function>Succ</function> are not written as <function>'Zero</function> and
             <function>'Succ</function>.
             </para>
-            <para>This warning is off by default.</para>
+            <para>This warning is enabled by default in <literal>-Wall</literal> mode.</para>
         </listitem>
       </varlistentry>
 



More information about the ghc-commits mailing list