bootInfo as API.
This commit is contained in:
33
src/Boot.hs
33
src/Boot.hs
@@ -1,33 +0,0 @@
|
||||
module Boot where
|
||||
|
||||
import Control.Applicative ((<$>))
|
||||
import CoreMonad (liftIO)
|
||||
import GHC (Ghc)
|
||||
import Language.Haskell.GhcMod
|
||||
import Language.Haskell.GhcMod.Ghc
|
||||
import Language.Haskell.GhcMod.Internal
|
||||
|
||||
bootInfo :: Options -> Cradle -> IO String
|
||||
bootInfo opt cradle = withGHC' $ do
|
||||
initializeFlagsWithCradle opt cradle
|
||||
boot opt
|
||||
|
||||
boot :: Options -> Ghc String
|
||||
boot opt = do
|
||||
mods <- modules opt
|
||||
langs <- liftIO $ listLanguages opt
|
||||
flags <- liftIO $ listFlags opt
|
||||
pre <- concat <$> mapM (browse opt) preBrowsedModules
|
||||
return $ mods ++ langs ++ flags ++ pre
|
||||
|
||||
preBrowsedModules :: [String]
|
||||
preBrowsedModules = [
|
||||
"Prelude"
|
||||
, "Control.Applicative"
|
||||
, "Control.Exception"
|
||||
, "Control.Monad"
|
||||
, "Data.Char"
|
||||
, "Data.List"
|
||||
, "Data.Maybe"
|
||||
, "System.IO"
|
||||
]
|
||||
@@ -17,8 +17,6 @@ import System.Environment (getArgs)
|
||||
import System.Exit (exitFailure)
|
||||
import System.IO (hPutStr, hPutStrLn, stdout, stderr, hSetEncoding, utf8)
|
||||
|
||||
import Boot
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
progVersion :: String
|
||||
|
||||
@@ -42,8 +42,6 @@ import System.Directory (setCurrentDirectory)
|
||||
import System.Environment (getArgs)
|
||||
import System.IO (hFlush,stdout)
|
||||
|
||||
import Boot
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
type Logger = IO String
|
||||
|
||||
Reference in New Issue
Block a user