diff options
author | David Waern <david.waern@gmail.com> | 2009-06-24 21:07:50 +0000 |
---|---|---|
committer | David Waern <david.waern@gmail.com> | 2009-06-24 21:07:50 +0000 |
commit | d02190da47dfd3712ce72cac6b36604f544dfb2b (patch) | |
tree | a5c0e1c5073802eef4e0fed7d5066289b0627574 /src/Haddock/Types.hs | |
parent | 1dc4c4b1cdaf8756968f47dee1e544029da362e0 (diff) |
Delete Haddock.Exception and move contents to Haddock.Types
Only a few lines of code that mainly declares a type - why not just put it in Haddock.Types.
Diffstat (limited to 'src/Haddock/Types.hs')
-rw-r--r-- | src/Haddock/Types.hs | 22 |
1 files changed, 22 insertions, 0 deletions
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 |