fromCabal -> fromCabalFile.
This commit is contained in:
parent
ca229c3be1
commit
aa0b1d709c
16
CabalApi.hs
16
CabalApi.hs
@ -1,7 +1,7 @@
|
||||
{-# LANGUAGE OverloadedStrings, RecordWildCards #-}
|
||||
|
||||
module CabalApi (
|
||||
fromCabal
|
||||
fromCabalFile
|
||||
, cabalParseFile
|
||||
, cabalBuildInfo
|
||||
, cabalAllDependPackages
|
||||
@ -22,13 +22,13 @@ import Types
|
||||
|
||||
----------------------------------------------------------------
|
||||
|
||||
fromCabal :: [GHCOption]
|
||||
-> Cradle
|
||||
-> IO ([GHCOption]
|
||||
,[IncludeDir]
|
||||
,[Package]
|
||||
,[LangExt])
|
||||
fromCabal ghcOptions cradle = do
|
||||
fromCabalFile :: [GHCOption]
|
||||
-> Cradle
|
||||
-> IO ([GHCOption]
|
||||
,[IncludeDir]
|
||||
,[Package]
|
||||
,[LangExt])
|
||||
fromCabalFile ghcOptions cradle = do
|
||||
cabal <- cabalParseFile cfile
|
||||
let binfo@BuildInfo{..} = cabalBuildInfo cabal
|
||||
let exts = map (("-X" ++) . display) $ usedExtensions binfo
|
||||
|
@ -47,7 +47,7 @@ initializeGHC opt cradle fileName ghcOptions logging
|
||||
| cabal =
|
||||
initSession opt ghcOptions importDirs Nothing Nothing logging fileName
|
||||
| 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
|
||||
where
|
||||
cabal = isJust $ cradleCabalFile cradle
|
||||
|
Loading…
Reference in New Issue
Block a user