summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2006-10-11 14:35:23 +0000
committerSimon Marlow <simonmar@microsoft.com>2006-10-11 14:35:23 +0000
commit046ee54f048ddd721dcee41916d6a6f68db3b15b (patch)
treeaf3cf2046b70499d21ffd1d2fd1ca8f63951f41b /compiler/utils
parent5199290f732017432869c9939934871e62c50b74 (diff)
downloadhaskell-046ee54f048ddd721dcee41916d6a6f68db3b15b.tar.gz
Module header tidyup #2
Push this further along, and fix build problems in the first patch.
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/Bag.lhs7
-rw-r--r--compiler/utils/Binary.hs4
-rw-r--r--compiler/utils/BufWrite.hs10
-rw-r--r--compiler/utils/Digraph.lhs18
-rw-r--r--compiler/utils/FastMutInt.lhs7
-rw-r--r--compiler/utils/FastTypes.lhs4
-rw-r--r--compiler/utils/FiniteMap.lhs6
-rw-r--r--compiler/utils/IOEnv.hs10
-rw-r--r--compiler/utils/ListSetOps.lhs4
-rw-r--r--compiler/utils/Maybes.lhs7
-rw-r--r--compiler/utils/OrdList.lhs1
-rw-r--r--compiler/utils/Outputable.lhs13
-rw-r--r--compiler/utils/Panic.lhs29
-rw-r--r--compiler/utils/Pretty.lhs6
-rw-r--r--compiler/utils/StringBuffer.lhs2
-rw-r--r--compiler/utils/UniqFM.lhs8
-rw-r--r--compiler/utils/UniqSet.lhs1
-rw-r--r--compiler/utils/Util.lhs31
18 files changed, 82 insertions, 86 deletions
diff --git a/compiler/utils/Bag.lhs b/compiler/utils/Bag.lhs
index ea85a8c134..d315c42074 100644
--- a/compiler/utils/Bag.lhs
+++ b/compiler/utils/Bag.lhs
@@ -1,7 +1,9 @@
%
+% (c) The University of Glasgow 2006
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-\section[Bags]{@Bag@: an unordered collection with duplicates}
+
+Bag: an unordered collection with duplicates
\begin{code}
module Bag (
@@ -20,7 +22,8 @@ module Bag (
import Outputable
import Util ( isSingleton )
-import List ( partition )
+
+import Data.List ( partition )
\end{code}
diff --git a/compiler/utils/Binary.hs b/compiler/utils/Binary.hs
index 1d5ab0e5ed..e479b791da 100644
--- a/compiler/utils/Binary.hs
+++ b/compiler/utils/Binary.hs
@@ -1,6 +1,6 @@
{-# OPTIONS -cpp #-}
--
--- (c) The University of Glasgow 2002
+-- (c) The University of Glasgow 2002-2006
--
-- Binary I/O library, with special tweaks for GHC
--
@@ -59,7 +59,7 @@ import Unique
import Panic
import UniqFM
import FastMutInt
-import PackageConfig ( PackageId, packageIdFS, fsToPackageId )
+import PackageConfig
import Foreign
import Data.Array.IO
diff --git a/compiler/utils/BufWrite.hs b/compiler/utils/BufWrite.hs
index a03db3d084..049a698708 100644
--- a/compiler/utils/BufWrite.hs
+++ b/compiler/utils/BufWrite.hs
@@ -2,7 +2,7 @@
--
-- Fast write-buffered Handles
--
--- (c) The University of Glasgow 2005
+-- (c) The University of Glasgow 2005-2006
--
-- This is a simple abstraction over Handles that offers very fast write
-- buffering, but without the thread safety that Handles provide. It's used
@@ -26,16 +26,16 @@ import FastString
import FastMutInt
import Panic ( panic )
-import Monad ( when )
-import Char ( ord )
+import Control.Monad ( when )
+import Data.Char ( ord )
import Foreign
-import IO
+import System.IO
import GHC.IOBase ( IO(..) )
import System.IO ( hPutBuf )
import GHC.Ptr ( Ptr(..) )
-import GLAEXTS ( Int(..), Int#, Addr# )
+import GHC.Exts ( Int(..), Int#, Addr# )
-- -----------------------------------------------------------------------------
diff --git a/compiler/utils/Digraph.lhs b/compiler/utils/Digraph.lhs
index 8fda332286..669f718b43 100644
--- a/compiler/utils/Digraph.lhs
+++ b/compiler/utils/Digraph.lhs
@@ -1,3 +1,7 @@
+%
+% (c) The University of Glasgow 2006
+%
+
\begin{code}
module Digraph(
@@ -34,22 +38,20 @@ module Digraph(
import Util ( sortLe )
+import Outputable
-- Extensions
-import MONAD_ST
+import Control.Monad.ST
-- std interfaces
-import Maybe
-import Array
-import List
-import Outputable
+import Data.Maybe
+import Data.Array
+import Data.List
#if __GLASGOW_HASKELL__ > 604
import Data.Array.ST
-#elif __GLASGOW_HASKELL__ >= 504
-import Data.Array.ST hiding ( indices, bounds )
#else
-import ST
+import Data.Array.ST hiding ( indices, bounds )
#endif
\end{code}
diff --git a/compiler/utils/FastMutInt.lhs b/compiler/utils/FastMutInt.lhs
index b483a1428e..86ca0bd7f7 100644
--- a/compiler/utils/FastMutInt.lhs
+++ b/compiler/utils/FastMutInt.lhs
@@ -1,6 +1,6 @@
{-# OPTIONS -cpp #-}
--
--- (c) The University of Glasgow 2002
+-- (c) The University of Glasgow 2002-2006
--
-- Unboxed mutable Ints
@@ -17,13 +17,8 @@ module FastMutInt(
#endif
-#if __GLASGOW_HASKELL__ < 503
-import GlaExts
-import PrelIOBase
-#else
import GHC.Base
import GHC.IOBase
-#endif
#if __GLASGOW_HASKELL__ < 411
newByteArray# = newCharArray#
diff --git a/compiler/utils/FastTypes.lhs b/compiler/utils/FastTypes.lhs
index bb92c8c02f..c58346d3f8 100644
--- a/compiler/utils/FastTypes.lhs
+++ b/compiler/utils/FastTypes.lhs
@@ -1,5 +1,5 @@
%
-% (c) The University of Glasgow, 2000
+% (c) The University of Glasgow, 2000-2006
%
\section{Fast integers and booleans}
@@ -17,7 +17,7 @@ module FastTypes (
#if defined(__GLASGOW_HASKELL__)
-- Import the beggars
-import GLAEXTS
+import GHC.Exts
( Int(..), Int#, (+#), (-#), (*#),
quotInt#, negateInt#, (==#), (<#), (<=#), (>=#), (>#)
)
diff --git a/compiler/utils/FiniteMap.lhs b/compiler/utils/FiniteMap.lhs
index 9168d3656f..6ac6b09397 100644
--- a/compiler/utils/FiniteMap.lhs
+++ b/compiler/utils/FiniteMap.lhs
@@ -1,7 +1,7 @@
-
+%
+% (c) The University of Glasgow 2006
% (c) The AQUA Project, Glasgow University, 1994-1998
%
-\section[FiniteMap]{An implementation of finite maps}
``Finite maps'' are the heart of the compiler's
lookup-tables/environments and its implementation of sets. Important
@@ -62,7 +62,7 @@ import Bag ( Bag, foldrBag )
import Util
import Outputable
-import GLAEXTS
+import GHC.Exts
#if ! OMIT_NATIVE_CODEGEN
# define IF_NCG(a) a
diff --git a/compiler/utils/IOEnv.hs b/compiler/utils/IOEnv.hs
index 8116effb33..c0277ae851 100644
--- a/compiler/utils/IOEnv.hs
+++ b/compiler/utils/IOEnv.hs
@@ -1,4 +1,5 @@
--- (c) The University of Glasgow 2002
+--
+-- (c) The University of Glasgow 2002-2006
--
-- The IO Monad with an environment
--
@@ -26,9 +27,10 @@ module IOEnv (
#include "HsVersions.h"
import Panic ( try, tryUser, tryMost, Exception(..) )
-import DATA_IOREF ( IORef, newIORef, readIORef, writeIORef )
-import UNSAFE_IO ( unsafeInterleaveIO )
-import FIX_IO ( fixIO )
+
+import Data.IORef ( IORef, newIORef, readIORef, writeIORef )
+import System.IO.Unsafe ( unsafeInterleaveIO )
+import System.IO ( fixIO )
----------------------------------------------------------------------
diff --git a/compiler/utils/ListSetOps.lhs b/compiler/utils/ListSetOps.lhs
index 02950722a2..becf9e6da2 100644
--- a/compiler/utils/ListSetOps.lhs
+++ b/compiler/utils/ListSetOps.lhs
@@ -1,4 +1,5 @@
%
+% (c) The University of Glasgow 2006
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
\section[ListSetOps]{Set-like operations on lists}
@@ -24,7 +25,8 @@ import Outputable
import Unique ( Unique )
import UniqFM ( eltsUFM, emptyUFM, addToUFM_C )
import Util ( isn'tIn, isIn, mapAccumR, sortLe )
-import List ( partition )
+
+import Data.List ( partition )
\end{code}
diff --git a/compiler/utils/Maybes.lhs b/compiler/utils/Maybes.lhs
index f1f859a5ea..7d1fa4e306 100644
--- a/compiler/utils/Maybes.lhs
+++ b/compiler/utils/Maybes.lhs
@@ -1,11 +1,11 @@
%
+% (c) The University of Glasgow 2006
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-\section[Maybes]{The `Maybe' types and associated utility functions}
\begin{code}
module Maybes (
- module Maybe, -- Re-export all of Maybe
+ module Data.Maybe, -- Re-export all of Maybe
MaybeErr(..), -- Instance of Monad
failME, isSuccess,
@@ -22,8 +22,7 @@ module Maybes (
#include "HsVersions.h"
-import Maybe
-
+import Data.Maybe
infixr 4 `orElse`
\end{code}
diff --git a/compiler/utils/OrdList.lhs b/compiler/utils/OrdList.lhs
index 7f22b38e49..7e797e096b 100644
--- a/compiler/utils/OrdList.lhs
+++ b/compiler/utils/OrdList.lhs
@@ -1,4 +1,5 @@
%
+% (c) The University of Glasgow 2006
% (c) The AQUA Project, Glasgow University, 1993-1998
%
diff --git a/compiler/utils/Outputable.lhs b/compiler/utils/Outputable.lhs
index 30960dc817..db744b1a05 100644
--- a/compiler/utils/Outputable.lhs
+++ b/compiler/utils/Outputable.lhs
@@ -1,10 +1,10 @@
%
+% (c) The University of Glasgow 2006
% (c) The GRASP Project, Glasgow University, 1992-1998
%
-\section[Outputable]{Classes for pretty-printing}
-Defines classes for pretty-printing and forcing, both forms of
-``output.''
+Outputable: defines classes for pretty-printing and forcing, both
+forms of ``output.''
\begin{code}
@@ -62,10 +62,9 @@ import qualified Pretty
import Pretty ( Doc, Mode(..) )
import Panic
-import DATA_WORD ( Word32 )
-
-import IO ( Handle, stderr, stdout, hFlush )
-import Char ( ord )
+import Data.Word ( Word32 )
+import System.IO ( Handle, stderr, stdout, hFlush )
+import Data.Char ( ord )
\end{code}
diff --git a/compiler/utils/Panic.lhs b/compiler/utils/Panic.lhs
index 1a74d5db32..42bf8b5220 100644
--- a/compiler/utils/Panic.lhs
+++ b/compiler/utils/Panic.lhs
@@ -1,7 +1,7 @@
%
+% (c) The University of Glasgow 2006
% (c) The GRASP Project, Glasgow University, 1992-2000
%
-\section{Panic error messages}
Defines basic funtions for printing error messages.
@@ -39,24 +39,15 @@ import Posix ( Handler(Catch), installHandler, sigINT, sigQUIT )
import GHC.ConsoleHandler
#endif
-# if __GLASGOW_HASKELL__ < 500
-import EXCEPTION ( raiseInThread )
-# else
-import EXCEPTION ( throwTo )
-# endif /* GHC < 500 */
-
-#if __GLASGOW_HASKELL__ > 408
-import EXCEPTION ( catchJust, tryJust, ioErrors )
-#endif
-
-import CONCURRENT ( myThreadId, MVar, ThreadId, withMVar, newEmptyMVar )
-import DYNAMIC
-import qualified EXCEPTION as Exception
-import TRACE ( trace )
-import UNSAFE_IO ( unsafePerformIO )
-import IO ( isUserError )
-
-import System
+import Control.Exception hiding (try)
+import Control.Concurrent ( myThreadId, MVar, ThreadId, withMVar, newEmptyMVar )
+import Data.Dynamic
+import qualified Control.Exception as Exception
+import Debug.Trace ( trace )
+import System.IO.Unsafe ( unsafePerformIO )
+import System.IO.Error ( isUserError )
+import System.Exit
+import System.Environment
\end{code}
GHC's own exception type.
diff --git a/compiler/utils/Pretty.lhs b/compiler/utils/Pretty.lhs
index ec8f1e75ad..31d65f26cb 100644
--- a/compiler/utils/Pretty.lhs
+++ b/compiler/utils/Pretty.lhs
@@ -180,12 +180,10 @@ module Pretty (
import BufWrite
import FastString
-import GLAEXTS
+import GHC.Exts
import Numeric (fromRat)
-import IO
-
-import System.IO ( hPutBuf )
+import System.IO
import GHC.Base ( unpackCString# )
import GHC.Ptr ( Ptr(..) )
diff --git a/compiler/utils/StringBuffer.lhs b/compiler/utils/StringBuffer.lhs
index e52e7e78da..8eb6fc2bc4 100644
--- a/compiler/utils/StringBuffer.lhs
+++ b/compiler/utils/StringBuffer.lhs
@@ -1,7 +1,7 @@
%
+% (c) The University of Glasgow 2006
% (c) The University of Glasgow, 1997-2006
%
-\section{String buffers}
Buffers for scanning string input stored in external arrays.
diff --git a/compiler/utils/UniqFM.lhs b/compiler/utils/UniqFM.lhs
index 2a02dc728d..267aeabd81 100644
--- a/compiler/utils/UniqFM.lhs
+++ b/compiler/utils/UniqFM.lhs
@@ -1,7 +1,9 @@
-%ilter
+%
+% (c) The University of Glasgow 2006
% (c) The AQUA Project, Glasgow University, 1994-1998
%
-\section[UniqFM]{Specialised finite maps, for things with @Uniques@}
+
+UniqFM: Specialised finite maps, for things with @Uniques@
Based on @FiniteMaps@ (as you would expect).
@@ -52,7 +54,7 @@ import Maybes ( maybeToBool )
import FastTypes
import Outputable
-import GLAEXTS -- Lots of Int# operations
+import GHC.Exts -- Lots of Int# operations
\end{code}
%************************************************************************
diff --git a/compiler/utils/UniqSet.lhs b/compiler/utils/UniqSet.lhs
index 129e333eb5..7d83f6f40f 100644
--- a/compiler/utils/UniqSet.lhs
+++ b/compiler/utils/UniqSet.lhs
@@ -1,4 +1,5 @@
%
+% (c) The University of Glasgow 2006
% (c) The AQUA Project, Glasgow University, 1994-1998
%
\section[UniqSet]{Specialised sets, for things with @Uniques@}
diff --git a/compiler/utils/Util.lhs b/compiler/utils/Util.lhs
index 522f795bcb..3eff34b3d5 100644
--- a/compiler/utils/Util.lhs
+++ b/compiler/utils/Util.lhs
@@ -1,4 +1,5 @@
%
+% (c) The University of Glasgow 2006
% (c) The University of Glasgow 1992-2002
%
\section[Util]{Highly random utility functions}
@@ -82,26 +83,26 @@ module Util (
import Panic ( panic, trace )
import FastTypes
-import EXCEPTION ( Exception(..), finally, throwDyn, catchDyn, throw )
-import qualified EXCEPTION as Exception
-import DYNAMIC ( Typeable )
-import DATA_IOREF ( IORef, newIORef )
-import UNSAFE_IO ( unsafePerformIO )
-import DATA_IOREF ( readIORef, writeIORef )
+import Control.Exception ( Exception(..), finally, catchDyn, throw )
+import qualified Control.Exception as Exception
+import Data.Dynamic ( Typeable )
+import Data.IORef ( IORef, newIORef )
+import System.IO.Unsafe ( unsafePerformIO )
+import Data.IORef ( readIORef, writeIORef )
-import qualified List ( elem, notElem )
+import qualified Data.List as List ( elem, notElem )
#ifndef DEBUG
-import List ( zipWith4 )
+import Data.List ( zipWith4 )
#endif
-import Monad ( when )
-import IO ( catch, isDoesNotExistError )
-import Directory ( doesDirectoryExist, createDirectory )
-import Char ( isUpper, isAlphaNum, isSpace, ord, isDigit )
-import Ratio ( (%) )
-import Time ( ClockTime )
-import Directory ( getModificationTime )
+import Control.Monad ( when )
+import SYSTEM_IO_ERROR as IO ( catch, isDoesNotExistError )
+import System.Directory ( doesDirectoryExist, createDirectory,
+ getModificationTime )
+import Data.Char ( isUpper, isAlphaNum, isSpace, ord, isDigit )
+import Data.Ratio ( (%) )
+import System.Time ( ClockTime )
infixr 9 `thenCmp`
\end{code}