<sect1 id="vs-Haskell-defn">
<title>Haskell 98 vs. Glasgow Haskell: language non-compliance
</title>
-
+
<indexterm><primary>GHC vs the Haskell 98 language</primary></indexterm>
<indexterm><primary>Haskell 98 language vs GHC</primary></indexterm>
<sect2 id="haskell98-divergence">
<title>Divergence from Haskell 98</title>
-
-
+
+
<sect3 id="infelicities-lexical">
<title>Lexical syntax</title>
-
+
<itemizedlist>
<listitem>
<para>Certain lexical rules regarding qualified identifiers
</listitem>
</itemizedlist>
</sect3>
-
+
<sect3 id="infelicities-syntax">
<title>Context-free syntax</title>
-
+
<itemizedlist>
<listitem>
<para>GHC is a little less strict about the layout rule when used
<option>-XNoMonoPatBinds</option>. See <xref
linkend="options-language" />.</para>
</sect3>
-
+
<sect3 id="infelicities-Modules">
<title>Module system and interface files</title>
-
+
<para>GHC requires the use of <literal>hs-boot</literal>
files to cut the recursive loops among mutually recursive modules
as described in <xref linkend="mutual-recursion"/>. This more of an infelicity
- than a bug: the Haskell Report says
+ than a bug: the Haskell Report says
(<ulink url="http://haskell.org/onlinereport/modules.html#sect5.7">Section 5.7</ulink>) "Depending on the Haskell
implementation used, separate compilation of mutually
recursive modules may require that imported modules contain
</listitem>
</varlistentry>
</variablelist>
-
+
</sect3>
<sect3 id="infelicities-Prelude">
<para>Negative literals, such as <literal>-3</literal>, are
- specified by (a careful reading of) the Haskell Report as
+ specified by (a careful reading of) the Haskell Report as
meaning <literal>Prelude.negate (Prelude.fromInteger 3)</literal>.
So <literal>-2147483648</literal> means <literal>negate (fromInteger 2147483648)</literal>.
Since <literal>fromInteger</literal> takes the lower 32 bits of the representation,
</listitem>
</varlistentry>
</variablelist>
-
+
</sect2>
<sect2 id="ffi-divergence">
<title>Divergence from the FFI specification</title>
-
+
<variablelist>
<varlistentry>
<term><literal>hs_init()</literal> not allowed
</varlistentry>
</variablelist>
</sect2>
-
+
</sect1>
</listitem>
<listitem>
- <para>GHC does not allow you to have a data type with a context
+ <para>GHC does not allow you to have a data type with a context
that mentions type variables that are not data type parameters.
For example:
<programlisting>
using the standard way to encode recursion via a data type:</para>
<programlisting>
data U = MkU (U -> Bool)
-
+
russel :: U -> Bool
russel u@(MkU p) = not $ p u
-
+
x :: Bool
x = russel (MkU russel)
</programlisting>
module (whatever that is).</para>
</listitem>
- <listitem>
+ <listitem>
<para>On Windows, there's a GNU ld/BFD bug
whereby it emits bogus PE object files that have more than
0xffff relocations. When GHCi tries to load a package affected by this