[commit: ghc] master: More docs for -XNumDecimals (61d2838)

git at git.haskell.org git at git.haskell.org
Thu Aug 29 07:15:31 CEST 2013


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/61d2838fa6d630340f70e18c76f295768c12072f/ghc

>---------------------------------------------------------------

commit 61d2838fa6d630340f70e18c76f295768c12072f
Author: Austin Seipp <aseipp at pobox.com>
Date:   Wed Aug 28 23:18:16 2013 -0500

    More docs for -XNumDecimals
    
    Signed-off-by: Austin Seipp <aseipp at pobox.com>


>---------------------------------------------------------------

61d2838fa6d630340f70e18c76f295768c12072f
 docs/users_guide/flags.xml        |    6 ++++++
 docs/users_guide/glasgow_exts.xml |   17 +++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml
index 282ca76..03252c2 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 0b16156..7a1af04 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 =======================  -->
 
 





More information about the ghc-commits mailing list