2010-04-30 09:36:31 +00:00
|
|
|
module Types where
|
|
|
|
|
|
|
|
import Exception
|
|
|
|
import GHC
|
|
|
|
import GHC.Paths (libdir)
|
|
|
|
|
|
|
|
data Options = Options {
|
2010-06-14 02:56:35 +00:00
|
|
|
convert :: [String] -> String
|
|
|
|
, hlintOpts :: [String]
|
2010-04-30 09:36:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|