summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-07-31 23:51:43 +0100
committerIan Lynagh <ian@well-typed.com>2013-07-31 23:54:40 +0100
commitffd7da35c140a38dd4410bb7edde27ea9fb2173c (patch)
treea2bab6943d14bf258c909cc4bbbb7e7e5f882d17
parentef739635a8c2646112d2a1fa4c8715704aff1f1f (diff)
downloadhaskell-ffd7da35c140a38dd4410bb7edde27ea9fb2173c.tar.gz
Document the Negative Literals extension
-rw-r--r--docs/users_guide/glasgow_exts.xml15
1 files changed, 15 insertions, 0 deletions
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index 57f94b4a76..f972a4bd56 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -440,6 +440,21 @@ Indeed, the bindings can even be recursive.
</para>
</sect2>
+ <sect2 id="negative-literals">
+ <title>Negative Literals</title>
+ <para>
+ The literal <literal>-123</literal> is, according to
+ Haskell98 and Haskell 2010, desugared as
+ <literal>negate (fromInteger 123)</literal>.
+ </para>
+
+ <para>
+ The language extension <option>-XNegativeLiterals</option>
+ means that it is instead desugared as
+ <literal>fromInteger (-123)</literal>.
+ </para>
+ </sect2>
+
<!-- ====================== HIERARCHICAL MODULES ======================= -->