ghc-mod/Types.hs
2010-05-06 15:29:55 +09:00

20 lines
424 B
Haskell

module Types where
import Exception
import GHC
import GHC.Paths (libdir)
data Options = Options {
convert :: [String] -> String
, hlint :: String
}
withGHC :: Ghc [String] -> IO [String]
withGHC body = ghandle ignore $ runGhc (Just libdir) body
where
ignore :: SomeException -> IO [String]
ignore _ = return []
initSession0 :: Ghc [PackageId]
initSession0 = getSessionDynFlags >>= setSessionDynFlags