summaryrefslogtreecommitdiff
path: root/compiler/main/SysTools.lhs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-09-14 20:17:03 +0000
committerIan Lynagh <igloo@earth.li>2010-09-14 20:17:03 +0000
commite95ee1f718c6915c478005aad8af81705357d6ab (patch)
tree0b19fdfd9d02b195b371e0f6ef8d413936113519 /compiler/main/SysTools.lhs
parent83a8fc9f6e04436784693a2188a58eac9c3e9664 (diff)
downloadhaskell-e95ee1f718c6915c478005aad8af81705357d6ab.tar.gz
Remove (most of) the FiniteMap wrapper
We still have insertList, insertListWith, deleteList which aren't in Data.Map, and foldRightWithKey which works around the fold(r)WithKey addition and deprecation.
Diffstat (limited to 'compiler/main/SysTools.lhs')
-rw-r--r--compiler/main/SysTools.lhs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
index 12b73d3bf2..1693aa06a9 100644
--- a/compiler/main/SysTools.lhs
+++ b/compiler/main/SysTools.lhs
@@ -45,7 +45,6 @@ import ErrUtils
import Panic
import Util
import DynFlags
-import FiniteMap
import Exception
import Data.IORef
@@ -58,6 +57,7 @@ import System.IO.Error as IO
import System.Directory
import Data.Char
import Data.List
+import qualified Data.Map as Map
#ifndef mingw32_HOST_OS
import qualified System.Posix.Internals
@@ -472,8 +472,8 @@ cleanTempDirs dflags
= unless (dopt Opt_KeepTmpFiles dflags)
$ do let ref = dirsToClean dflags
ds <- readIORef ref
- removeTmpDirs dflags (eltsFM ds)
- writeIORef ref emptyFM
+ removeTmpDirs dflags (Map.elems ds)
+ writeIORef ref Map.empty
cleanTempFiles :: DynFlags -> IO ()
cleanTempFiles dflags
@@ -515,7 +515,7 @@ getTempDir :: DynFlags -> IO FilePath
getTempDir dflags@(DynFlags{tmpDir=tmp_dir})
= do let ref = dirsToClean dflags
mapping <- readIORef ref
- case lookupFM mapping tmp_dir of
+ case Map.lookup tmp_dir mapping of
Nothing ->
do x <- getProcessID
let prefix = tmp_dir </> "ghc" ++ show x ++ "_"
@@ -524,7 +524,7 @@ getTempDir dflags@(DynFlags{tmpDir=tmp_dir})
mkTempDir x
= let dirname = prefix ++ show x
in do createDirectory dirname
- let mapping' = addToFM mapping tmp_dir dirname
+ let mapping' = Map.insert tmp_dir dirname mapping
writeIORef ref mapping'
debugTraceMsg dflags 2 (ptext (sLit "Created temporary directory:") <+> text dirname)
return dirname