summaryrefslogtreecommitdiff
path: root/compiler/utils
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2011-07-11 14:30:39 +0100
committerSimon Marlow <marlowsd@gmail.com>2011-07-12 11:16:14 +0100
commit6d51aa7a2809cdf2b18b350931a1e3b87e442153 (patch)
treea5ce2266be80ca3e8bc80470cccc3a4c35647386 /compiler/utils
parent82c997cc0b1c03a49c20ad193676aa00cf1413cd (diff)
downloadhaskell-6d51aa7a2809cdf2b18b350931a1e3b87e442153.tar.gz
derive Typeable (eliminate deprecation warnings for mkTyCon)
Diffstat (limited to 'compiler/utils')
-rw-r--r--compiler/utils/Panic.lhs10
-rw-r--r--compiler/utils/UniqFM.lhs3
2 files changed, 4 insertions, 9 deletions
diff --git a/compiler/utils/Panic.lhs b/compiler/utils/Panic.lhs
index d430df695e..1fd815604c 100644
--- a/compiler/utils/Panic.lhs
+++ b/compiler/utils/Panic.lhs
@@ -78,7 +78,7 @@ data GhcException
-- | An error in the user's code, probably.
| ProgramError String
- deriving Eq
+ deriving (Typeable, Eq)
instance Exception GhcException
@@ -87,9 +87,6 @@ instance Show GhcException where
showsPrec _ e@(CmdLineError _) = showString "<command line>: " . showGhcException e
showsPrec _ e = showString progName . showString ": " . showGhcException e
-instance Typeable GhcException where
- typeOf _ = mkTyConApp ghcExceptionTc []
-
-- | The name of this GHC.
progName :: String
@@ -154,11 +151,6 @@ handleGhcException :: ExceptionMonad m => (GhcException -> m a) -> m a -> m a
handleGhcException = ghandle
-ghcExceptionTc :: TyCon
-ghcExceptionTc = mkTyCon "GhcException"
-{-# NOINLINE ghcExceptionTc #-}
-
-
-- | Panics and asserts.
panic, sorry, pgmError :: String -> a
panic x = throwGhcException (Panic x)
diff --git a/compiler/utils/UniqFM.lhs b/compiler/utils/UniqFM.lhs
index 9c9fdc9bc4..7cbc3dbcfb 100644
--- a/compiler/utils/UniqFM.lhs
+++ b/compiler/utils/UniqFM.lhs
@@ -67,6 +67,8 @@ import Compiler.Hoopl hiding (Unique)
import Data.Function (on)
import qualified Data.IntMap as M
import qualified Data.Foldable as Foldable
+import Data.Typeable
+import Data.Data
\end{code}
%************************************************************************
@@ -164,6 +166,7 @@ ufmToList :: UniqFM elt -> [(Unique, elt)]
\begin{code}
newtype UniqFM ele = UFM { unUFM :: M.IntMap ele }
+ deriving (Typeable,Data)
instance Eq ele => Eq (UniqFM ele) where
(==) = (==) `on` unUFM