Fix the SPECIALISE error in the haddock invocation of validate
[ghc-hetmet.git] / docs / users_guide / bugs.xml
index ab0b9be..9b167cc 100644 (file)
@@ -5,7 +5,7 @@
   <sect1 id="vs-Haskell-defn">
     <title>Haskell&nbsp;98 vs.&nbsp;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&nbsp;98</title>
-    
-      
+
+
     <sect3 id="infelicities-lexical">
       <title>Lexical syntax</title>
-      
-      <itemizedlist>
-       <listitem>
-         <para>The Haskell report specifies that programs may be
-         written using Unicode.  GHC only accepts the ISO-8859-1
-         character set at the moment.</para>
-       </listitem>
 
+      <itemizedlist>
        <listitem>
          <para>Certain lexical rules regarding qualified identifiers
          are slightly different in GHC compared to the Haskell
        </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
@@ -102,13 +96,30 @@ main = do args &lt;- getArgs
     <sect3 id="infelicities-decls">
       <title>Declarations and bindings</title>
 
-      <para>None known.</para>
+      <para>GHC's typechecker makes all pattern bindings monomorphic
+      by default; this behaviour can be disabled with
+      <option>-XNoMonoPatBinds</option>.  See <xref
+      linkend="options-language" />.</para>
     </sect3>
-      
+
       <sect3 id="infelicities-Modules">
        <title>Module system and interface files</title>
-       
-       <para>None known.</para>
+
+       <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
+         (<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
+       additional information so that they may be referenced before
+       they are compiled. Explicit type signatures for all exported
+       values may be necessary to deal with mutual recursion. The
+       precise details of separate compilation are not defined by
+       this Report."
+
+       </para>
+
     </sect3>
 
     <sect3 id="infelicities-numbers">
@@ -130,7 +141,7 @@ checking for duplicates.  The reason for this is efficiency, pure and simple.
          </listitem>
        </varlistentry>
       </variablelist>
-      
+
     </sect3>
 
       <sect3 id="infelicities-Prelude">
@@ -180,6 +191,22 @@ checking for duplicates.  The reason for this is efficiency, pure and simple.
               alphabetic by <literal>isAlpha</literal>.</para>
            </listitem>
          </varlistentry>
+
+          <varlistentry>
+            <term><literal>hGetContents</literal></term>
+            <listitem>
+              <para>
+                Lazy I/O throws an exception if an error is
+                encountered, in contrast to the Haskell 98 spec which
+                requires that errors are discarded (see Section 21.2.2
+                of the Haskell 98 report).  The exception thrown is
+                the usual IO exception that would be thrown if the
+                failing IO operation was performed in the IO monad, and can
+                be caught by <literal>System.IO.Error.catch</literal>
+                or <literal>Control.Exception.catch</literal>.
+              </para>
+            </listitem>
+          </varlistentry>
        </variablelist>
     </sect3>
   </sect2>
@@ -224,7 +251,7 @@ checking for duplicates.  The reason for this is efficiency, pure and simple.
          the <literal>Int</literal> type.</para>
 
          <para>The <literal>fromInteger</literal><indexterm><primary><literal>fromInteger</literal></primary>
-           </indexterm>function (and hence
+           </indexterm> function (and hence
          also <literal>fromIntegral</literal><indexterm><primary><literal>fromIntegral</literal></primary>
            </indexterm>) is a special case when
          converting to <literal>Int</literal>.  The value of
@@ -238,7 +265,7 @@ checking for duplicates.  The reason for this is efficiency, pure and simple.
 
 
           <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,
@@ -275,8 +302,26 @@ checking for duplicates.  The reason for this is efficiency, pure and simple.
        </listitem>
       </varlistentry>
     </variablelist>
-      
+
     </sect2>
+
+  <sect2 id="ffi-divergence">
+    <title>Divergence from the FFI specification</title>
+
+    <variablelist>
+      <varlistentry>
+        <term><literal>hs_init()</literal> not allowed
+        after <literal>hs_exit()</literal></term>
+        <listitem>
+          <para>The FFI spec requires the implementation to support
+            re-initialising itself after being shut down
+            with <literal>hs_exit()</literal>, but GHC does not
+            currently support that.</para>
+        </listitem>
+      </varlistentry>
+    </variablelist>
+  </sect2>
+
   </sect1>
 
 
@@ -303,7 +348,7 @@ checking for duplicates.  The reason for this is efficiency, pure and simple.
       </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>
@@ -324,10 +369,10 @@ checking for duplicates.  The reason for this is efficiency, pure and simple.
         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>
@@ -337,7 +382,7 @@ checking for duplicates.  The reason for this is efficiency, pure and simple.
         the problem would impose an extra overhead on every
         compilation.  So the bug remains un-fixed.  There is more
         background in <ulink
-        url="http://research.microsoft.com/~simonpj/Papers/inlining">
+        url="http://research.microsoft.com/~simonpj/Papers/inlining/">
         Secrets of the GHC inliner</ulink>.</para>
       </listitem>
 
@@ -369,7 +414,7 @@ checking for duplicates.  The reason for this is efficiency, pure and simple.
         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
@@ -394,7 +439,6 @@ Loading package javavm ... linking ... WARNING: Overflown relocation field (# re
 
 <!-- Emacs stuff:
      ;;; Local Variables: ***
-     ;;; mode: xml ***
      ;;; sgml-parent-document: ("users_guide.xml" "book" "chapter") ***
      ;;; End: ***
  -->