Commit d9d1dd9e authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Rename ask* to get* to avoid mixing up oracles with expressions.

parent 179d1cd8
......@@ -19,9 +19,9 @@ ghcMArgs = do
stage <- asks getStage
builder (GhcM stage) ? do
pkg <- asks getPackage
cppArgs <- askPkgDataList CppArgs
hsArgs <- askPkgDataList HsArgs
hsSrcs <- askHsSources
cppArgs <- getPkgDataList CppArgs
hsArgs <- getPkgDataList HsArgs
hsSrcs <- getHsSources
ways <- fromDiffExpr Settings.Ways.ways
let buildPath = targetPath stage pkg -/- "build"
mconcat
......@@ -41,9 +41,9 @@ packageGhcArgs :: Args
packageGhcArgs = do
stage <- asks getStage
supportsPackageKey <- lift . flag $ SupportsPackageKey
pkgKey <- askPkgData PackageKey
pkgDepKeys <- askPkgDataList DepKeys
pkgDeps <- askPkgDataList Deps
pkgKey <- getPkgData PackageKey
pkgDepKeys <- getPkgDataList DepKeys
pkgDeps <- getPkgDataList Deps
mconcat
[ arg "-hide-all-packages"
, arg "-no-user-package-db"
......@@ -59,8 +59,8 @@ includeGhcArgs :: Args
includeGhcArgs = do
stage <- asks getStage
pkg <- asks getPackage
srcDirs <- askPkgDataList SrcDirs
includeDirs <- askPkgDataList IncludeDirs
srcDirs <- getPkgDataList SrcDirs
includeDirs <- getPkgDataList IncludeDirs
let buildPath = targetPath stage pkg -/- "build"
autogenPath = buildPath -/- "autogen"
mconcat
......@@ -74,18 +74,18 @@ includeGhcArgs = do
, arg "-optP-include" -- TODO: Shall we also add -cpp?
, arg $ "-optP" ++ autogenPath -/- "cabal_macros.h" ]
askHsSources :: Expr [FilePath]
askHsSources = do
getHsSources :: Expr [FilePath]
getHsSources = do
stage <- asks getStage
pkg <- asks getPackage
srcDirs <- askPkgDataList SrcDirs
srcDirs <- getPkgDataList SrcDirs
let autogenPath = targetPath stage pkg -/- "build/autogen"
dirs = autogenPath : map (pkgPath pkg -/-) srcDirs
askModuleFiles dirs [".hs", ".lhs"]
getModuleFiles dirs [".hs", ".lhs"]
askModuleFiles :: [FilePath] -> [String] -> Expr [FilePath]
askModuleFiles directories suffixes = do
modules <- askPkgDataList Modules
getModuleFiles :: [FilePath] -> [String] -> Expr [FilePath]
getModuleFiles directories suffixes = do
modules <- getPkgDataList Modules
let modPaths = map (replaceEq '.' pathSeparator) modules
files <- lift $ forM [ dir -/- modPath ++ suffix
| dir <- directories
......
......@@ -2,7 +2,7 @@ module Settings.Util (
-- Primitive settings elements
arg, argM,
argSetting, argSettingList,
askPkgData, askPkgDataList,
getPkgData, getPkgDataList,
appendCcArgs,
needBuilder
-- argBuilderPath, argStagedBuilderPath,
......@@ -34,15 +34,15 @@ argSetting = argM . setting
argSettingList :: SettingList -> Args
argSettingList = appendM . settingList
askPkgData :: (FilePath -> PackageData) -> Expr String
askPkgData key = do
getPkgData :: (FilePath -> PackageData) -> Expr String
getPkgData key = do
stage <- asks getStage
pkg <- asks getPackage
let path = targetPath stage pkg
lift . pkgData . key $ path
askPkgDataList :: (FilePath -> PackageDataList) -> Expr [String]
askPkgDataList key = do
getPkgDataList :: (FilePath -> PackageDataList) -> Expr [String]
getPkgDataList key = do
stage <- asks getStage
pkg <- asks getPackage
let path = targetPath stage pkg
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment