From 73bf4cbc4eccca2583af99a7a5a4326265366c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Fri, 11 Jul 2014 10:40:09 +0200 Subject: [PATCH] Remove `withGhc` and `withGhc'`, they're not used anymore. --- Language/Haskell/GhcMod/GHCApi.hs | 25 ++----------------------- Language/Haskell/GhcMod/Ghc.hs | 5 +---- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/Language/Haskell/GhcMod/GHCApi.hs b/Language/Haskell/GhcMod/GHCApi.hs index 2cd0886..ba98bfe 100644 --- a/Language/Haskell/GhcMod/GHCApi.hs +++ b/Language/Haskell/GhcMod/GHCApi.hs @@ -1,9 +1,7 @@ {-# LANGUAGE ScopedTypeVariables, RecordWildCards #-} module Language.Haskell.GhcMod.GHCApi ( - withGHC - , withGHC' - , initializeFlagsWithCradle + initializeFlagsWithCradle , setTargetFiles , getDynamicFlags , systemLibDir @@ -39,26 +37,6 @@ systemLibDir = libdir ---------------------------------------------------------------- --- | Converting the 'Ghc' monad to the 'IO' monad. -withGHC :: FilePath -- ^ A target file displayed in an error message. - -> Ghc a -- ^ 'Ghc' actions created by the Ghc utilities. - -> IO a -withGHC file body = ghandle ignore $ withGHC' body - where - ignore :: SomeException -> IO a - ignore e = do - hPutStr stderr $ file ++ ":0:0:Error:" - hPrint stderr e - exitSuccess - -withGHC' :: Ghc a -> IO a -withGHC' body = do - G.runGhc (Just systemLibDir) $ do - dflags <- G.getSessionDynFlags - G.defaultCleanupHandler dflags body - ----------------------------------------------------------------- - importDirs :: [IncludeDir] importDirs = [".","..","../..","../../..","../../../..","../../../../.."] @@ -107,6 +85,7 @@ initSession build Options {..} CompilerOptions {..} = do $ setEmptyLogger $ Gap.addPackageFlags depPackages df) + setEmptyLogger :: DynFlags -> DynFlags setEmptyLogger df = Gap.setLogAction df $ \_ _ _ _ _ -> return () diff --git a/Language/Haskell/GhcMod/Ghc.hs b/Language/Haskell/GhcMod/Ghc.hs index b2259db..0d2cd20 100644 --- a/Language/Haskell/GhcMod/Ghc.hs +++ b/Language/Haskell/GhcMod/Ghc.hs @@ -1,9 +1,6 @@ module Language.Haskell.GhcMod.Ghc ( - -- * Converting the 'Ghc' monad to the 'IO' monad - withGHC - , withGHC' -- * 'SymMdlDb' - , Symbol + Symbol , SymMdlDb , getSymMdlDb , lookupSym