aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--haddock.cabal2
-rw-r--r--src/Haddock/Exception.hs34
-rw-r--r--src/Haddock/Options.hs2
-rw-r--r--src/Haddock/Types.hs22
-rw-r--r--src/Main.hs1
5 files changed, 23 insertions, 38 deletions
diff --git a/haddock.cabal b/haddock.cabal
index 9fe53e43..bc222ef6 100644
--- a/haddock.cabal
+++ b/haddock.cabal
@@ -110,7 +110,6 @@ executable haddock
Haddock.Types
Haddock.Version
Haddock.InterfaceFile
- Haddock.Exception
Haddock.Options
Haddock.GhcUtils
@@ -130,7 +129,6 @@ library
other-modules:
Haddock.Types
Haddock.InterfaceFile
- Haddock.Exception
Haddock.Utils
Haddock.GhcUtils
diff --git a/src/Haddock/Exception.hs b/src/Haddock/Exception.hs
deleted file mode 100644
index eabc722e..00000000
--- a/src/Haddock/Exception.hs
+++ /dev/null
@@ -1,34 +0,0 @@
---
--- Haddock - A Haskell Documentation Tool
---
--- (c) Simon Marlow 2003
---
-
-
-{-# LANGUAGE DeriveDataTypeable #-}
-
-
-module Haddock.Exception (
- HaddockException,
- throwE
-) where
-
-
-import Data.Typeable
-import Control.Exception
-
-
-data HaddockException = HaddockException String deriving Typeable
-
-
-instance Show HaddockException where
- show (HaddockException str) = str
-
-
-throwE :: String -> a
-#if __GLASGOW_HASKELL__ >= 609
-instance Exception HaddockException
-throwE str = throw (HaddockException str)
-#else
-throwE str = throwDyn (HaddockException str)
-#endif
diff --git a/src/Haddock/Options.hs b/src/Haddock/Options.hs
index 03901f7b..5e5bedd3 100644
--- a/src/Haddock/Options.hs
+++ b/src/Haddock/Options.hs
@@ -15,7 +15,7 @@ module Haddock.Options (
import Haddock.Utils
-import Haddock.Exception
+import Haddock.Types
import System.Console.GetOpt
diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs
index 34e16ec1..9e6c746c 100644
--- a/src/Haddock/Types.hs
+++ b/src/Haddock/Types.hs
@@ -1,4 +1,5 @@
{-# OPTIONS_HADDOCK hide #-}
+{-# LANGUAGE DeriveDataTypeable #-}
--
-- Haddock - A Haskell Documentation Tool
@@ -10,6 +11,8 @@
module Haddock.Types where
+import Control.Exception
+import Data.Typeable
import Data.Map (Map)
import qualified Data.Map as Map
import GHC hiding (NoLink)
@@ -233,3 +236,22 @@ instance Monad ErrMsgM where
tell :: [ErrMsg] -> ErrMsgM ()
tell w = Writer ((), w)
+
+
+-- Exceptions
+
+-- | Haddock's own exception type
+data HaddockException = HaddockException String deriving Typeable
+
+
+instance Show HaddockException where
+ show (HaddockException str) = str
+
+
+throwE :: String -> a
+#if __GLASGOW_HASKELL__ >= 609
+instance Exception HaddockException
+throwE str = throw (HaddockException str)
+#else
+throwE str = throwDyn (HaddockException str)
+#endif
diff --git a/src/Main.hs b/src/Main.hs
index c4b916b6..6d85378a 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -19,7 +19,6 @@ import Haddock.Interface
import Haddock.Types
import Haddock.Version
import Haddock.InterfaceFile
-import Haddock.Exception
import Haddock.Options
import Haddock.Utils
import Haddock.GhcUtils