giving up loading Data.ByteString.

This commit is contained in:
Kazu Yamamoto 2014-04-21 20:36:16 +09:00
parent 69cacb0865
commit 6f9ceb94e2
2 changed files with 7 additions and 30 deletions

View File

@ -30,7 +30,7 @@ unloaded modules are loaded")
;; must be sorted
(defconst ghc-reserved-keyword '("case" "deriving" "do" "else" "if" "in" "let" "module" "of" "then" "where"))
(defconst ghc-extra-keywords '()) ;; was '("ByteString")
(defconst ghc-extra-keywords '("ByteString" "Text"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
@ -58,12 +58,9 @@ unloaded modules are loaded")
(defvar ghc-keyword-Control.Applicative nil)
(defvar ghc-keyword-Control.Exception nil)
(defvar ghc-keyword-Control.Monad nil)
(defvar ghc-keyword-Data.ByteString nil)
(defvar ghc-keyword-Data.Char nil)
(defvar ghc-keyword-Data.List nil)
(defvar ghc-keyword-Data.Maybe nil)
(defvar ghc-keyword-System.Directory nil)
(defvar ghc-keyword-System.FilePath nil)
(defvar ghc-keyword-System.IO nil)
(defvar ghc-loaded-module nil)
@ -77,12 +74,9 @@ unloaded modules are loaded")
ghc-keyword-Control.Applicative
ghc-keyword-Control.Exception
ghc-keyword-Control.Monad
ghc-keyword-Data.ByteString
ghc-keyword-Data.Char
ghc-keyword-Data.List
ghc-keyword-Data.Maybe
ghc-keyword-System.Directory
ghc-keyword-System.FilePath
ghc-keyword-System.IO))
(vals (ghc-boot (length syms))))
(ghc-set syms vals))
@ -93,12 +87,9 @@ unloaded modules are loaded")
"Control.Applicative"
"Control.Exception"
"Control.Monad"
"Data.ByteString"
"Data.Char"
"Data.List"
"Data.Maybe"
"System.Directory"
"System.FilePath"
"System.IO")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -114,7 +105,10 @@ unloaded modules are loaded")
(defun ghc-load-modules (mods)
(if mods
(prog2
(message "Loading symbols...")
(mapcar 'ghc-load-module mods)
(message "Loading symbols...done"))
(message "No new modules")
nil))

View File

@ -11,8 +11,7 @@ boot opt cradle = do
mods <- listModules opt cradle
langs <- listLanguages opt
flags <- listFlags opt
let opt' = addPackages opt
pre <- concat <$> mapM (browseModule opt' cradle) preBrowsedModules
pre <- concat <$> mapM (browseModule opt cradle) preBrowsedModules
return $ mods ++ langs ++ flags ++ pre
boot' :: Options -> Ghc String
@ -20,8 +19,7 @@ boot' opt = do
mods <- modules opt
langs <- liftIO $ listLanguages opt
flags <- liftIO $ listFlags opt
let opt' = addPackages opt
pre <- concat <$> mapM (browse opt') preBrowsedModules
pre <- concat <$> mapM (browse opt) preBrowsedModules
return $ mods ++ langs ++ flags ++ pre
preBrowsedModules :: [String]
@ -30,23 +28,8 @@ preBrowsedModules = [
, "Control.Applicative"
, "Control.Exception"
, "Control.Monad"
, "Data.ByteString"
, "Data.Char"
, "Data.List"
, "Data.Maybe"
, "System.Directory"
, "System.FilePath"
, "System.IO"
]
preBrowsePackages :: [String]
preBrowsePackages = [
"bytestring"
, "directory"
, "filepath"
]
addPackages :: Options -> Options
addPackages opt = opt { ghcOpts = pkgs ++ ghcOpts opt}
where
pkgs = map ("-package " ++) preBrowsePackages