summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 ======================= -->