[project @ 2002-02-27 10:26:13 by simonmar]
authorsimonmar <unknown>
Wed, 27 Feb 2002 10:29:12 +0000 (10:29 +0000)
committersimonmar <unknown>
Wed, 27 Feb 2002 10:29:12 +0000 (10:29 +0000)
Expand on the behaviour of fromIntegral a bit.

ghc/docs/users_guide/vs_haskell.sgml

index 5ad9f98..87c6b9c 100644 (file)
@@ -220,6 +220,15 @@ main = print (array (1,1) [(1,2), (1,3)])</programlisting>
          arithmetic).  This behaviour was chosen so that for example
          writing <literal>0xffffffff :: Int</literal> preserves the
          bit-pattern in the resulting <literal>Int</literal>.</para>
+
+         <para>The <literal>fromIntegral</literal> function also
+         preserves bit-patterns when converting between the sized
+         integral types (<literal>Int8</literal>,
+         <literal>Int16</literal>, <literal>Int32</literal>,
+         <literal>Int64</literal> and the unsigned
+         <literal>Word</literal> variants), see <xref
+         linkend="sec-Int"> and <xref linkend="sec-Word">.</para>
+
        </listitem>
       </varlistentry>