-% ------------------------------------------------------------------------------
-% $Id: IOBase.lhs,v 1.8 2002/04/11 12:03:44 simonpj Exp $
-%
-% (c) The University of Glasgow, 1994-2001
-%
-
-% Definitions for the @IO@ monad and its friends. Everything is exported
-% concretely; the @IO@ module itself exports abstractly.
-
\begin{code}
{-# OPTIONS -fno-implicit-prelude #-}
+-----------------------------------------------------------------------------
+-- |
+-- Module : GHC.IOBase
+-- Copyright : (c) The University of Glasgow 1994-2002
+-- License : see libraries/base/LICENSE
+--
+-- Maintainer : cvs-ghc@haskell.org
+-- Stability : internal
+-- Portability : non-portable (GHC Extensions)
+--
+-- Definitions for the 'IO' monad and its friends.
+--
+-----------------------------------------------------------------------------
module GHC.IOBase where
import GHC.Show
import GHC.List
import GHC.Read
+
+#ifndef __HADDOCK__
import {-# SOURCE #-} Data.Dynamic
+#endif
-- ---------------------------------------------------------------------------
-- The IO Monad
-- effects. For output, items are written out from the internal
-- buffer according to the buffer mode:
--
--- * line-buffering the entire output buffer is written
+-- o line-buffering the entire output buffer is written
-- out whenever a newline is output, the output buffer overflows,
-- a flush is issued, or the handle is closed.
--
--- * block-buffering the entire output buffer is written out whenever
+-- o block-buffering the entire output buffer is written out whenever
-- it overflows, a flush is issued, or the handle
-- is closed.
--
--- * no-buffering output is written immediately, and never stored
+-- o no-buffering output is written immediately, and never stored
-- in the output buffer.
--
-- The output buffer is emptied as soon as it has been written out.
-- Similarly, input occurs according to the buffer mode for handle {\em hdl}.
--- * line-buffering when the input buffer for the handle is not empty,
+-- o line-buffering when the input buffer for the handle is not empty,
-- the next item is obtained from the buffer;
-- otherwise, when the input buffer is empty,
-- characters up to and including the next newline
-- are available until the newline character is
-- available.
--
--- * block-buffering when the input buffer for the handle becomes empty,
+-- o block-buffering when the input buffer for the handle becomes empty,
-- the next block of data is read into this buffer.
--
--- * no-buffering the next input item is read and returned.
+-- o no-buffering the next input item is read and returned.
-- For most implementations, physical files will normally be block-buffered
-- and terminals will normally be line-buffered. (the IO interface provides