Permalink
Browse files

fix of deprecated warnings

  • Loading branch information...
1 parent 029e8c3 commit b733f3093c802aeeaf0502a8b2174a6cd8b21531 @atzedijkstra atzedijkstra committed Sep 18, 2012
Showing with 15 additions and 11 deletions.
  1. +3 −3 EHC/src/ehc/Base/Serialize.chs
  2. +8 −6 EHC/src/ehc/EHC/CompilePhase/Parsers.chs
  3. +4 −2 EHC/src/ehc/EHC/CompileRun.chs
@@ -230,7 +230,7 @@ putRef c i
sputShared :: (Ord x, Serialize x, Typeable x) => x -> SPut
sputShared x
= do { s <- St.get
- ; let tykey = tyConString $ typeRepTyCon $ typeOf x
+ ; let tykey = tyConName $ typeRepTyCon $ typeOf x
; case Map.lookup tykey (sputsSMp s) of
Just (SerPutMp m)
-> case Map.lookup xcasted m of
@@ -274,7 +274,7 @@ sgetShared
-> do { i <- lift (getRef cmd)
; x <- sgetNested
; s <- St.get
- ; let tykey = tyConString $ typeRepTyCon $ typeOf (undefined :: x)
+ ; let tykey = tyConName $ typeRepTyCon $ typeOf (undefined :: x)
; case Map.lookup tykey (sgetsSMp s) of
Just (SerGetMp m)
-> St.put (s { sgetsSMp = Map.insert tykey (SerGetMp (Map.insert i xcasted m)) (sgetsSMp s)
@@ -287,7 +287,7 @@ sgetShared
SCmd_ShareRef
-> do { i <- lift (getRef cmd)
; s <- St.get
- ; let tykey = tyConString $ typeRepTyCon $ typeOf (undefined :: x)
+ ; let tykey = tyConName $ typeRepTyCon $ typeOf (undefined :: x)
; case Map.lookup tykey (sgetsSMp s) of
Just (SerGetMp m)
-> return $ panicJust "Serialize.sgetShared C" $ cast $ panicJust "Serialize.sgetShared B" $ Map.lookup i m
@@ -13,6 +13,8 @@ CompilePhase building blocks: parsers
%%]
%%[8 import(EH.Util.ParseUtils)
%%]
+%%[99 import(Control.Exception as CE)
+%%]
%%[8 import({%{EH}EHC.Common})
%%]
@@ -212,12 +214,12 @@ cpDecodeHIInfo modNm
%%]]
; cpMsg' modNm VerboseALot "Decoding" Nothing fpH
; hiinfo <- lift $
- catch (do { i <- getSGetFile (fpathToStr fpH) (HI.sgetHIInfo opts)
- -- getSerializeFile (fpathToStr fpH)
- -- Bin.getBinaryFPath fpH
- ; return i
- })
- (\_ -> return $ HI.emptyHIInfo {HI.hiiValidity = HI.HIValidity_Absent})
+ CE.catch (do { i <- getSGetFile (fpathToStr fpH) (HI.sgetHIInfo opts)
+ -- getSerializeFile (fpathToStr fpH)
+ -- Bin.getBinaryFPath fpH
+ ; return i
+ })
+ (\(_ :: SomeException) -> return $ HI.emptyHIInfo {HI.hiiValidity = HI.HIValidity_Absent})
; when (ehcOptVerbosity opts > VerboseALot)
(do { lift $ putPPLn (pp hiinfo)
})
@@ -16,6 +16,8 @@ An EHC compile run maintains info for one compilation invocation
%%]
%%[99 import(System.Directory)
%%]
+%%[99 import(Control.Exception as CE)
+%%]
%%[99 import(EH.Util.FPath)
%%]
%%[99 import({%{EH}Base.PackageDatabase})
@@ -272,8 +274,8 @@ cpRmFilesToRm
; lift $ mapM rm files
; cpUpdSI (\crsi -> crsi {crsiFilesToRm = []})
}
- where rm f = catch (removeFile f)
- (\e -> hPutStrLn stderr (show f ++ ": " ++ show e))
+ where rm f = CE.catch (removeFile f)
+ (\(e :: SomeException) -> hPutStrLn stderr (show f ++ ": " ++ show e))
%%]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

0 comments on commit b733f30

Please sign in to comment.