More docs for -XNumDecimals
authorAustin Seipp <aseipp@pobox.com>
Thu, 29 Aug 2013 04:18:16 +0000 (23:18 -0500)
committerAustin Seipp <aseipp@pobox.com>
Thu, 29 Aug 2013 04:18:16 +0000 (23:18 -0500)
Signed-off-by: Austin Seipp <aseipp@pobox.com>
docs/users_guide/flags.xml
docs/users_guide/glasgow_exts.xml

index 282ca76..03252c2 100644 (file)
             <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>
index 0b16156..7a1af04 100644 (file)
@@ -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 =======================  -->