ghc-mod/src/Boot.hs

36 lines
891 B
Haskell
Raw Normal View History

2014-04-21 02:57:14 +00:00
module Boot where
import Control.Applicative ((<$>))
2014-04-21 07:30:31 +00:00
import CoreMonad (liftIO)
import GHC (Ghc)
import Language.Haskell.GhcMod
import Language.Haskell.GhcMod.Ghc
2014-04-21 02:57:14 +00:00
boot :: Options -> Cradle -> IO String
boot opt cradle = do
mods <- listModules opt cradle
langs <- listLanguages opt
flags <- listFlags opt
2014-04-21 11:36:16 +00:00
pre <- concat <$> mapM (browseModule opt cradle) preBrowsedModules
2014-04-21 02:57:14 +00:00
return $ mods ++ langs ++ flags ++ pre
2014-04-21 07:30:31 +00:00
boot' :: Options -> Ghc String
boot' opt = do
mods <- modules opt
langs <- liftIO $ listLanguages opt
flags <- liftIO $ listFlags opt
2014-04-21 11:36:16 +00:00
pre <- concat <$> mapM (browse opt) preBrowsedModules
2014-04-21 07:30:31 +00:00
return $ mods ++ langs ++ flags ++ pre
2014-04-21 02:57:14 +00:00
preBrowsedModules :: [String]
preBrowsedModules = [
"Prelude"
, "Control.Applicative"
, "Control.Exception"
, "Control.Monad"
, "Data.Char"
, "Data.List"
, "Data.Maybe"
, "System.IO"
]