[commit: ghc] wip/nfs-locking: Rename ShowAction to ShowArgs. (0da6908)

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


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

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

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

commit 0da69088be65109832fa78a93bc0dc21fcd37f09
Author: Andrey Mokhov <andrey.mokhov at ncl.ac.uk>
Date:   Fri Jan 9 17:23:32 2015 +0000

    Rename ShowAction to ShowArgs.


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

0da69088be65109832fa78a93bc0dc21fcd37f09
 src/Oracles/Builder.hs     | 14 +++++++-------
 src/Oracles/Option.hs      | 12 ++++++------
 src/Oracles/PackageData.hs |  4 ++--
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/Oracles/Builder.hs b/src/Oracles/Builder.hs
index 84b73b3..d91e5e7 100644
--- a/src/Oracles/Builder.hs
+++ b/src/Oracles/Builder.hs
@@ -14,8 +14,8 @@ import Oracles.Option
 
 data Builder = Ar | Ld | Gcc | Alex | Happy | HsColour | GhcCabal | GhcPkg Stage | Ghc Stage
 
-instance ShowAction Builder where
-    showAction builder = showAction $ do
+instance ShowArgs Builder where
+    showArgs builder = showArgs $ do
         let key = case builder of
                 Ar            -> "ar"
                 Ld            -> "ld"
@@ -50,12 +50,12 @@ instance ShowAction Builder where
 -- the flag (at least temporarily).
 needBuilder :: Builder -> Action ()
 needBuilder ghc @ (Ghc stage) = do
-    [target] <- showAction ghc
+    [target] <- showArgs ghc
     laxDeps  <- test LaxDeps
     if laxDeps then orderOnly [target] else need [target]
 
 needBuilder builder = do 
-    [target] <- showAction builder
+    [target] <- showArgs builder
     need [target]
 
 -- Action 'with Gcc' returns an argument '--with-gcc=/path/to/gcc' and needs the builder 
@@ -70,18 +70,18 @@ with builder = do
             Happy    -> "--with-happy="
             GhcPkg _ -> "--with-ghc-pkg="
             HsColour -> "--with-hscolour="
-    [suffix] <- showAction builder
+    [suffix] <- showArgs builder
     needBuilder builder
     return [prefix ++ suffix]
 
 run :: Builder -> Args -> Action ()
 run builder args = do
     needBuilder builder
-    [exe] <- showAction builder
+    [exe] <- showArgs builder
     args' <- args
     cmd [exe] args'
 
 hsColourSrcs :: Condition
 hsColourSrcs = do
-    [hscolour] <- showAction HsColour
+    [hscolour] <- showArgs HsColour
     return $ hscolour /= ""
diff --git a/src/Oracles/Option.hs b/src/Oracles/Option.hs
index 6f05a0e..d08b394 100644
--- a/src/Oracles/Option.hs
+++ b/src/Oracles/Option.hs
@@ -12,8 +12,8 @@ data Option = TargetOS | TargetArch | TargetPlatformFull
             | SrcHcOpts
             | HostOsCpp
 
-instance ShowAction Option where
-    showAction opt = showAction $ fmap words $ askConfig $ case opt of 
+instance ShowArgs Option where
+    showArgs opt = showArgs $ fmap words $ askConfig $ case opt of 
         TargetOS                -> "target-os"
         TargetArch              -> "target-arch"
         TargetPlatformFull      -> "target-platform-full"
@@ -30,8 +30,8 @@ instance ShowAction Option where
 
 ghcWithInterpreter :: Condition
 ghcWithInterpreter = do
-    [os]   <- showAction TargetOS
-    [arch] <- showAction TargetArch
+    [os]   <- showArgs TargetOS
+    [arch] <- showArgs TargetArch
     return $
         os `elem` ["mingw32", "cygwin32", "linux", "solaris2", "freebsd", "dragonfly", "netbsd", "openbsd", "darwin", "kfreebsdgnu"]
         &&
@@ -39,10 +39,10 @@ ghcWithInterpreter = do
 
 platformSupportsSharedLibs :: Condition
 platformSupportsSharedLibs = do
-    [platform] <- showAction TargetPlatformFull
+    [platform] <- showArgs TargetPlatformFull
     return $ platform `notElem` [ "powerpc-unknown-linux", "x86_64-unknown-mingw32", "i386-unknown-mingw32" ] -- TODO: i386-unknown-solaris2?
 
 windowsHost :: Condition
 windowsHost = do
-    [hostOsCpp] <- showAction HostOsCpp
+    [hostOsCpp] <- showArgs HostOsCpp
     return $ hostOsCpp `elem` ["mingw32", "cygwin32"]
diff --git a/src/Oracles/PackageData.hs b/src/Oracles/PackageData.hs
index 4ec89d7..ba63612 100644
--- a/src/Oracles/PackageData.hs
+++ b/src/Oracles/PackageData.hs
@@ -15,8 +15,8 @@ newtype PackageDataKey = PackageDataKey (FilePath, String)
 data PackageData = Modules FilePath | SrcDirs FilePath | PackageKey FilePath 
                  | IncludeDirs FilePath | Deps FilePath | DepKeys FilePath
 
-instance ShowAction PackageData where
-    showAction key = do
+instance ShowArgs PackageData where
+    showArgs key = do
         let (keyName, file, ifEmpty) = case key of
                Modules     file -> ("MODULES"     , file, "" )
                SrcDirs     file -> ("HS_SRC_DIRS" , file, ".")



More information about the ghc-commits mailing list