fromCabal -> fromCabalFile.

This commit is contained in:
Kazu Yamamoto 2013-03-03 15:50:09 +09:00
parent ca229c3be1
commit aa0b1d709c
2 changed files with 9 additions and 9 deletions

View File

@ -1,7 +1,7 @@
{-# LANGUAGE OverloadedStrings, RecordWildCards #-} {-# LANGUAGE OverloadedStrings, RecordWildCards #-}
module CabalApi ( module CabalApi (
fromCabal fromCabalFile
, cabalParseFile , cabalParseFile
, cabalBuildInfo , cabalBuildInfo
, cabalAllDependPackages , cabalAllDependPackages
@ -22,13 +22,13 @@ import Types
---------------------------------------------------------------- ----------------------------------------------------------------
fromCabal :: [GHCOption] fromCabalFile :: [GHCOption]
-> Cradle -> Cradle
-> IO ([GHCOption] -> IO ([GHCOption]
,[IncludeDir] ,[IncludeDir]
,[Package] ,[Package]
,[LangExt]) ,[LangExt])
fromCabal ghcOptions cradle = do fromCabalFile ghcOptions cradle = do
cabal <- cabalParseFile cfile cabal <- cabalParseFile cfile
let binfo@BuildInfo{..} = cabalBuildInfo cabal let binfo@BuildInfo{..} = cabalBuildInfo cabal
let exts = map (("-X" ++) . display) $ usedExtensions binfo let exts = map (("-X" ++) . display) $ usedExtensions binfo

View File

@ -47,7 +47,7 @@ initializeGHC opt cradle fileName ghcOptions logging
| cabal = | cabal =
initSession opt ghcOptions importDirs Nothing Nothing logging fileName initSession opt ghcOptions importDirs Nothing Nothing logging fileName
| otherwise = do | otherwise = do
(gopts,idirs,depPkgs,hdrExts) <- liftIO $ fromCabal ghcOptions cradle (gopts,idirs,depPkgs,hdrExts) <- liftIO $ fromCabalFile ghcOptions cradle
initSession opt gopts idirs (Just depPkgs) (Just hdrExts) logging fileName initSession opt gopts idirs (Just depPkgs) (Just hdrExts) logging fileName
where where
cabal = isJust $ cradleCabalFile cradle cabal = isJust $ cradleCabalFile cradle