aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Binary.hs2
-rw-r--r--src/HaddockDB.hs5
-rw-r--r--src/HaddockDevHelp.hs4
-rw-r--r--src/HaddockHH.hs7
-rw-r--r--src/HaddockHH2.hs7
-rw-r--r--src/HaddockHtml.hs37
-rw-r--r--src/HaddockRename.hs2
-rw-r--r--src/HaddockUtil.hs28
-rw-r--r--src/Main.hs58
-rw-r--r--src/Map.hs10
-rw-r--r--src/PrettyPrint.hs7
-rw-r--r--src/Set.hs4
12 files changed, 62 insertions, 109 deletions
diff --git a/src/Binary.hs b/src/Binary.hs
index eb7b9929..f3bc6477 100644
--- a/src/Binary.hs
+++ b/src/Binary.hs
@@ -105,8 +105,6 @@ import GHC.Word ( Word8(..) )
-- openFileEx is available from the lang package, but we want to
-- be independent of hslibs libraries.
import GHC.Handle ( openFileEx, IOModeEx(..) )
-#else
-import System.IO ( openBinaryFile )
#endif
#endif
diff --git a/src/HaddockDB.hs b/src/HaddockDB.hs
index 33e63a8b..a56ebada 100644
--- a/src/HaddockDB.hs
+++ b/src/HaddockDB.hs
@@ -6,10 +6,13 @@
module HaddockDB (ppDocBook) where
+{-
import HaddockTypes
import HaddockUtil
import HsSyn
-import PrettyPrint
+
+import Text.PrettyPrint
+-}
-----------------------------------------------------------------------------
-- Printing the results in DocBook format
diff --git a/src/HaddockDevHelp.hs b/src/HaddockDevHelp.hs
index 51cf5da2..51e96ea0 100644
--- a/src/HaddockDevHelp.hs
+++ b/src/HaddockDevHelp.hs
@@ -5,9 +5,9 @@ import HaddockTypes
import HaddockUtil
import HsSyn hiding(Doc)
import qualified Map
-import PrettyPrint
-import Maybe ( fromMaybe )
+import Data.Maybe ( fromMaybe )
+import Text.PrettyPrint
ppDevHelpFile :: FilePath -> String -> Maybe String -> [(Module,Interface)] -> IO ()
diff --git a/src/HaddockHH.hs b/src/HaddockHH.hs
index 40d74967..d5bf7109 100644
--- a/src/HaddockHH.hs
+++ b/src/HaddockHH.hs
@@ -5,13 +5,10 @@ import HaddockTypes
import HaddockUtil
import HsSyn hiding(Doc)
import qualified Map
-import PrettyPrint
-#if __GLASGOW_HASKELL__ >= 503
import Data.Char ( toUpper )
-#endif
-
-import Maybe ( fromMaybe )
+import Data.Maybe ( fromMaybe )
+import Text.PrettyPrint
ppHHContents :: FilePath -> String -> Maybe String -> [ModuleTree] -> IO ()
ppHHContents odir doctitle maybe_package tree = do
diff --git a/src/HaddockHH2.hs b/src/HaddockHH2.hs
index c71d6045..9e023dda 100644
--- a/src/HaddockHH2.hs
+++ b/src/HaddockHH2.hs
@@ -5,13 +5,10 @@ import HaddockTypes
import HaddockUtil
import HsSyn hiding(Doc)
import qualified Map
-import PrettyPrint
-#if __GLASGOW_HASKELL__ >= 503
import Data.Char ( toUpper )
-#endif
-
-import Maybe ( fromMaybe )
+import Data.Maybe ( fromMaybe )
+import Text.PrettyPrint
ppHH2Contents :: FilePath -> String -> Maybe String -> [ModuleTree] -> IO ()
ppHH2Contents odir doctitle maybe_package tree = do
diff --git a/src/HaddockHtml.hs b/src/HaddockHtml.hs
index c4bda56c..ced6e351 100644
--- a/src/HaddockHtml.hs
+++ b/src/HaddockHtml.hs
@@ -11,31 +11,28 @@ module HaddockHtml (
) where
import Prelude hiding (div)
-import HaddockVersion
-import HaddockTypes
-import HaddockUtil
-import HaddockModuleTree
+
+import Binary ( openBinaryFile )
+import HaddockDevHelp
import HaddockHH
import HaddockHH2
-import HaddockDevHelp
+import HaddockModuleTree
+import HaddockTypes
+import HaddockUtil
+import HaddockVersion
import HsSyn
-import Map ( Map )
-import qualified Map
-
-import Maybe ( fromJust, isJust, mapMaybe )
-import List ( sortBy )
-import Char ( isUpper, toUpper )
-import Monad ( when, unless )
-
-
-import Foreign
-import Control.Exception ( handle, bracket )
-
-import Binary ( openBinaryFile )
-import System.IO ( IOMode(..), hClose, hGetBuf, hPutBuf )
-
import Html
import qualified Html
+import Map ( Map )
+import qualified Map hiding ( Map )
+
+import Control.Exception ( bracket )
+import Control.Monad ( when, unless )
+import Data.Char ( isUpper, toUpper )
+import Data.List ( sortBy )
+import Data.Maybe ( fromJust, isJust, mapMaybe )
+import Foreign.Marshal.Alloc ( allocaBytes )
+import System.IO ( IOMode(..), hClose, hGetBuf, hPutBuf )
-- -----------------------------------------------------------------------------
-- Generating HTML documentation
diff --git a/src/HaddockRename.hs b/src/HaddockRename.hs
index 429ad992..6f8aafc5 100644
--- a/src/HaddockRename.hs
+++ b/src/HaddockRename.hs
@@ -16,7 +16,7 @@ module HaddockRename (
import HaddockTypes
import HsSyn
import Map ( Map )
-import qualified Map
+import qualified Map hiding ( Map )
import Monad
diff --git a/src/HaddockUtil.hs b/src/HaddockUtil.hs
index 3b8f3a13..434d935e 100644
--- a/src/HaddockUtil.hs
+++ b/src/HaddockUtil.hs
@@ -25,30 +25,24 @@ module HaddockUtil (
html_xrefs_ref,
) where
+import Binary
import HaddockLex
import HaddockParse
import HaddockTypes
-
import HsSyn
import Map ( Map )
-import qualified Map
-
-import List ( intersect, isSuffixOf, intersperse )
-import Maybe
-import IO ( hPutStr, stderr )
-import System
-import Binary
-import Monad
-import Char ( isAlpha, isSpace, toUpper, ord )
+import qualified Map hiding ( Map )
-#if __GLASGOW_HASKELL__ < 503
-import IOExts
-import URI ( escapeString, unreserved )
-#else
-import Data.IORef
-import System.IO.Unsafe ( unsafePerformIO )
+import Control.Monad ( liftM, MonadPlus(..) )
+import Data.Char ( isAlpha, isSpace, toUpper, ord )
+import Data.IORef ( IORef, newIORef, readIORef )
+import Data.List ( intersect, isSuffixOf, intersperse )
+import Data.Maybe ( maybeToList, fromMaybe )
import Network.URI ( escapeString, unreserved )
-#endif
+import System.Environment ( getProgName )
+import System.Exit ( exitWith, ExitCode(..) )
+import System.IO ( hPutStr, stderr )
+import System.IO.Unsafe ( unsafePerformIO )
-- -----------------------------------------------------------------------------
-- Some Utilities
diff --git a/src/Main.hs b/src/Main.hs
index ea72c130..c2681594 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -6,52 +6,34 @@
module Main (main) where
-import HaddockVersion
-import HaddockRename
-import HaddockParse
-import HaddockLex
+import Binary
+import Digraph
--import HaddockDB -- not compiling
import HaddockHtml
+import HaddockLex
+import HaddockParse
+import HaddockRename
import HaddockTypes
import HaddockUtil
-import Digraph
-import Binary
-
-import Map ( Map )
-import qualified Map
-import Set
-import HsParser
+import HaddockVersion
import HsParseMonad
+import HsParser
import HsSyn
-import System
-
---import Pretty
-
-import Maybe ( isJust, maybeToList )
-import List ( nub )
-import Monad ( when )
-import Char ( isSpace )
-import IO
+import Map ( Map )
+import qualified Map hiding ( Map )
+import Set
-#if __GLASGOW_HASKELL__ < 503
-import MonadWriter
-import GetOpt
-import IOExts
-#else
-import Control.Monad.Writer
-import System.Console.GetOpt
-import Data.IORef
+import Control.Exception ( bracket )
+import Control.Monad ( when )
+import Control.Monad.Writer ( Writer, runWriter, tell )
+import Data.Char ( isSpace )
+import Data.IORef ( writeIORef )
+import Data.List ( nub )
+import Data.Maybe ( isJust, maybeToList )
--import Debug.Trace
-import System.IO.Unsafe ( unsafePerformIO )
-#endif
-
-import Foreign
-import Foreign.C
-
-#if __GLASGOW_HASKELL__ < 500
-import Regex
-import PackedString
-#endif
+import System.Console.GetOpt ( getOpt, usageInfo, ArgOrder(..), OptDescr(..), ArgDescr(..) )
+import System.Environment ( getArgs )
+import System.IO ( stderr, IOMode(..), openFile, hClose, hGetContents, hPutStrLn )
-----------------------------------------------------------------------------
-- Top-level stuff
diff --git a/src/Map.hs b/src/Map.hs
index 16cebdee..173d4fcf 100644
--- a/src/Map.hs
+++ b/src/Map.hs
@@ -11,15 +11,11 @@ module Map (
import Prelude hiding ( lookup )
-#if __GLASGOW_HASKELL__ < 503
-import FiniteMap
-#elif __GLASGOW_HASKELL__ < 603
-import Data.FiniteMap
-#else
+#if __GLASGOW_HASKELL__ >= 603
import Data.Map
-#endif
+#else
+import Data.FiniteMap
-#if __GLASGOW_HASKELL__ < 603
type Map k a = FiniteMap k a
member :: Ord k => k -> Map k a -> Bool
diff --git a/src/PrettyPrint.hs b/src/PrettyPrint.hs
deleted file mode 100644
index 35d91dc1..00000000
--- a/src/PrettyPrint.hs
+++ /dev/null
@@ -1,7 +0,0 @@
-module PrettyPrint ( module Pretty ) where
-
-#if __GLASGOW_HASKELL__ < 503
-import Pretty
-#else
-import Text.PrettyPrint as Pretty
-#endif
diff --git a/src/Set.hs b/src/Set.hs
index 271828e8..383d23f8 100644
--- a/src/Set.hs
+++ b/src/Set.hs
@@ -6,11 +6,7 @@ module Set (
elems, fromList
) where
-#if __GLASGOW_HASKELL__ < 503
-import Set
-#else
import Data.Set
-#endif
#if __GLASGOW_HASKELL__ < 603
member :: Ord a => a -> Set a -> Bool