summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorAustin Seipp <aseipp@pobox.com>2013-08-28 23:18:16 -0500
committerAustin Seipp <aseipp@pobox.com>2013-08-28 23:18:16 -0500
commit61d2838fa6d630340f70e18c76f295768c12072f (patch)
tree0a8db57ac607c91dfc3694ecde8af0fdefb91a47 /docs
parent1122f0dc141f55a2dfcb4e95310d4a6a2bebe4ea (diff)
downloadhaskell-61d2838fa6d630340f70e18c76f295768c12072f.tar.gz
More docs for -XNumDecimals
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/flags.xml6
-rw-r--r--docs/users_guide/glasgow_exts.xml17
2 files changed, 23 insertions, 0 deletions
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index 282ca7624b..03252c26a3 100644
--- a/docs/users_guide/flags.xml
+++ b/docs/users_guide/flags.xml
@@ -796,6 +796,12 @@
<entry><option>-XNoNegativeLiterals</option></entry>
</row>
<row>
+ <entry><option>-XNumDecimals</option></entry>
+ <entry>Enable support for 'fractional' integer literals</entry>
+ <entry>dynamic</entry>
+ <entry><option>-XNoNumDecimals</option></entry>
+ </row>
+ <row>
<entry><option>-XNoTraditionalRecordSyntax</option></entry>
<entry>Disable support for traditional record syntax (as supported by Haskell 98) <literal>C {f = x}</literal></entry>
<entry>dynamic</entry>
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index 0b16156595..7a1af04bf7 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -455,6 +455,23 @@ Indeed, the bindings can even be recursive.
</para>
</sect2>
+ <sect2 id="num-decimals">
+ <title>Fractional looking integer literals</title>
+ <para>
+ Haskell 2010 and Haskell 98 define floating literals with
+ the syntax <literal>1.2e6</literal>. These literals have the
+ type <literal>Fractional a => Fractional</literal>.
+ </para>
+
+ <para>
+ The language extension <option>-XNumLiterals</option> allows
+ you to also use the floating literal syntax for instances of
+ <literal>Integral</literal>, and have values like
+ <literal>(1.2e6 :: Integral a => a)</literal>
+ </para>
+ </sect2>
+
+
<!-- ====================== HIERARCHICAL MODULES ======================= -->