summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorCarlos Tomé <carlostome1990@gmail.com>2014-12-05 14:36:55 -0600
committerAustin Seipp <austin@well-typed.com>2014-12-05 18:35:33 -0600
commit87160c1a5e5c742de176b29d8c3a596fba0983cf (patch)
tree4ecd449502bd814d27cac14ef605d725c5b4939d /docs
parent9a1010745e68f7d10692767d8f7a65216618d329 (diff)
downloadhaskell-87160c1a5e5c742de176b29d8c3a596fba0983cf.tar.gz
renamer: fix trac issue #9778
Summary: Added flag -fwarn-unticked-promoted-constructors Test Plan: test T9778 under tests/rename/should_compile Reviewers: jstolarek, simonpj, austin Reviewed By: jstolarek, simonpj, austin Subscribers: simonpj, goldfire, jstolarek, thomie, carter Differential Revision: https://phabricator.haskell.org/D534 GHC Trac Issues: #9778
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/flags.xml7
-rw-r--r--docs/users_guide/using.xml24
2 files changed, 31 insertions, 0 deletions
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index 9ddd2710c5..6ba0c6f164 100644
--- a/docs/users_guide/flags.xml
+++ b/docs/users_guide/flags.xml
@@ -1570,6 +1570,13 @@
</row>
<row>
+ <entry><option>-fwarn-unticked-promoted-constructors</option></entry>
+ <entry>warn if promoted constructors are not ticked </entry>
+ <entry>dynamic</entry>
+ <entry><option>-fno-warn-unticked-promoted-constructors</option></entry>
+ </row>
+
+ <row>
<entry><option>-fwarn-unused-binds</option></entry>
<entry>warn about bindings that are unused</entry>
<entry>dynamic</entry>
diff --git a/docs/users_guide/using.xml b/docs/users_guide/using.xml
index 396af6cd06..8006fffc18 100644
--- a/docs/users_guide/using.xml
+++ b/docs/users_guide/using.xml
@@ -1796,6 +1796,30 @@ f "2" = 2
</varlistentry>
<varlistentry>
+ <term><option>-fwarn-unticked-promoted-constructors</option>:</term>
+ <listitem>
+ <indexterm><primary><option>-fwarn-unticked-promoted-constructors</option></primary></indexterm>
+ <indexterm><primary>promoted constructor, warning</primary></indexterm>
+ <para>Warn if a promoted data constructor is used without a tick preceding it's 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 off by default.</para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><option>-fwarn-unused-binds</option>:</term>
<listitem>
<indexterm><primary><option>-fwarn-unused-binds</option></primary></indexterm>