X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=ghc%2FInteractiveUI.hs;h=2f3ca85dece9910fb2251e960c61aac479139d99;hp=a2ba64ef07536e3d977c8595cfff35b9c9da9bd0;hb=b00e3a6c0a82a8af3238d677f798d812cd7fd49f;hpb=9d1a7251a138829f59cc1cf052ee2d3f5603d67b diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index a2ba64e..2f3ca85 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -280,7 +280,7 @@ helpText = findEditor :: IO String findEditor = do getEnv "EDITOR" - `IO.catch` \_ -> do + `catchIO` \_ -> do #if mingw32_HOST_OS win <- System.Win32.getWindowsDirectory return (win "notepad.exe") @@ -369,14 +369,16 @@ interactiveUI srcs maybe_exprs = do withGhcAppData :: (FilePath -> IO a) -> IO a -> IO a withGhcAppData right left = do - either_dir <- IO.try (getAppUserDataDirectory "ghc") - case either_dir of - Right dir -> right dir - _ -> left + either_dir <- IO.try (getAppUserDataDirectory "ghc") + case either_dir of + Right dir -> + do createDirectoryIfMissing False dir `catchIO` \_ -> return () + right dir + _ -> left runGHCi :: [(FilePath, Maybe Phase)] -> Maybe [String] -> GHCi () runGHCi paths maybe_exprs = do - let + let read_dot_files = not opt_IgnoreDotGhci current_dir = return (Just ".ghci") @@ -411,7 +413,7 @@ runGHCi paths maybe_exprs = do Right hdl -> do runInputTWithPrefs defaultPrefs defaultSettings $ runCommands $ fileLoop hdl - liftIO (hClose hdl `IO.catch` \_ -> return ()) + liftIO (hClose hdl `catchIO` \_ -> return ()) where getDirectory f = case takeDirectory f of "" -> "."; d -> d