Document that lazy I/O now throws exceptions
authorSimon Marlow <marlowsd@gmail.com>
Mon, 12 Oct 2009 15:42:13 +0000 (15:42 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Mon, 12 Oct 2009 15:42:13 +0000 (15:42 +0000)
docs/users_guide/6.12.1-notes.xml
docs/users_guide/bugs.xml

index f1d1ed5..9e0ecbf 100644 (file)
@@ -692,6 +692,19 @@ ghc --abi-hash M1 M2 ...
 
         <listitem>
           <para>
+            Lazy I/O now throws an exception if an error is
+            encountered, in a divergence from 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>
+
+        <listitem>
+          <para>
             It is now possible to create your own handles.
             For more information, see the
             <literal>GHC.IO.Handle</literal> haddock docs.
index 7fd47c9..6e25e68 100644 (file)
@@ -192,15 +192,21 @@ checking for duplicates.  The reason for this is efficiency, pure and simple.
            </listitem>
          </varlistentry>
 
-         <varlistentry>
-           <term>Strings treated as ISO-8859-1</term>
-           <listitem>
-             <para>
-            Various library functions, such as <literal>putStrLn</literal>,
-            treat Strings as if they were ISO-8859-1 rather than UTF-8.
-          </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>