[commit: ghc] wip/nfs-locking: Rename ask* to get* to avoid mixing up oracles with expressions. (d9d1dd9e)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:31:15 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/d9d1dd9ef0d2827579f9c7c647e081156a14c8ab/ghc

>---------------------------------------------------------------

commit d9d1dd9ef0d2827579f9c7c647e081156a14c8ab
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Fri Jul 24 13:15:29 2015 +0100

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


>---------------------------------------------------------------

d9d1dd9ef0d2827579f9c7c647e081156a14c8ab
 src/Settings/GhcM.hs | 30 +++++++++++++++---------------
 src/Settings/Util.hs | 10 +++++-----
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/src/Settings/GhcM.hs b/src/Settings/GhcM.hs
index 4f792e0..89c4634 100644
--- a/src/Settings/GhcM.hs
+++ b/src/Settings/GhcM.hs
@@ -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
diff --git a/src/Settings/Util.hs b/src/Settings/Util.hs
index 4fadcd7..22ffd29 100644
--- a/src/Settings/Util.hs
+++ b/src/Settings/Util.hs
@@ -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



More information about the ghc-commits mailing list