[commit: ghc] wip/nfs-locking: Rename redError(_) to putError(_). (9a6f684)

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


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

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

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

commit 9a6f68428bc2ae6ce0ec2188cb43a48938d8ff87
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Wed Aug 5 22:29:05 2015 +0100

    Rename redError(_) to putError(_).


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

9a6f68428bc2ae6ce0ec2188cb43a48938d8ff87
 src/Builder.hs      |  2 +-
 src/Oracles/Base.hs |  4 ++--
 src/Oracles/Flag.hs |  4 ++--
 src/Util.hs         | 10 +++++-----
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/Builder.hs b/src/Builder.hs
index a148fc5..b175fac 100644
--- a/src/Builder.hs
+++ b/src/Builder.hs
@@ -58,7 +58,7 @@ builderKey builder = case builder of
 builderPath :: Builder -> Action String
 builderPath builder = do
     path <- askConfigWithDefault (builderKey builder) $
-            redError $ "\nCannot find path to '" ++ (builderKey builder)
+            putError $ "\nCannot find path to '" ++ (builderKey builder)
                      ++ "' in configuration files."
     fixAbsolutePathOnWindows $ if null path then "" else path -<.> exe
 
diff --git a/src/Oracles/Base.hs b/src/Oracles/Base.hs
index 5c2a252..29ec4e4 100644
--- a/src/Oracles/Base.hs
+++ b/src/Oracles/Base.hs
@@ -22,7 +22,7 @@ askConfigWithDefault key defaultAction = do
         Nothing    -> defaultAction
 
 askConfig :: String -> Action String
-askConfig key = askConfigWithDefault key . redError
+askConfig key = askConfigWithDefault key . putError
     $ "Cannot find key '" ++ key ++ "' in configuration files."
 
 -- Oracle for configuration files
@@ -31,7 +31,7 @@ configOracle = do
     let configFile = configPath -/- "system.config"
     cfg <- newCache $ \() -> do
         unlessM (doesFileExist $ configFile <.> "in") $
-            redError_ $ "\nConfiguration file '" ++ (configFile <.> "in")
+            putError_ $ "\nConfiguration file '" ++ (configFile <.> "in")
                       ++ "' is missing; unwilling to proceed."
         need [configFile]
         putOracle $ "Reading " ++ configFile ++ "..."
diff --git a/src/Oracles/Flag.hs b/src/Oracles/Flag.hs
index dfa0920..391ed5e 100644
--- a/src/Oracles/Flag.hs
+++ b/src/Oracles/Flag.hs
@@ -28,9 +28,9 @@ flag f = do
         SolarisBrokenShld  -> "solaris-broken-shld"
         SplitObjectsBroken -> "split-objects-broken"
         GhcUnregisterised  -> "ghc-unregisterised"
-    value <- askConfigWithDefault key . redError
+    value <- askConfigWithDefault key . putError
         $ "\nFlag '" ++ key ++ "' not set in configuration files."
-    unless (value == "YES" || value == "NO") . redError
+    unless (value == "YES" || value == "NO") . putError
         $ "\nFlag '" ++ key ++ "' is set to '" ++ value
         ++ "' instead of 'YES' or 'NO'."
     return $ value == "YES"
diff --git a/src/Util.hs b/src/Util.hs
index 70de3ec..32b6478 100644
--- a/src/Util.hs
+++ b/src/Util.hs
@@ -4,7 +4,7 @@ module Util (
     replaceIf, replaceEq, replaceSeparators,
     unifyPath, (-/-),
     chunksOfSize,
-    putColoured, putOracle, putBuild, redError, redError_,
+    putColoured, putOracle, putBuild, putError, putError_,
     bimap, minusOrd, intersectOrd
     ) where
 
@@ -65,13 +65,13 @@ putBuild :: String -> Action ()
 putBuild = putColoured White
 
 -- A more colourful version of error
-redError :: String -> Action a
-redError msg = do
+putError :: String -> Action a
+putError msg = do
     putColoured Red msg
     error $ "GHC build system error: " ++ msg
 
-redError_ :: String -> Action ()
-redError_ = void . redError
+putError_ :: String -> Action ()
+putError_ = void . putError
 
 -- Depending on Data.Bifunctor only for this function seems an overkill
 bimap :: (a -> b) -> (c -> d) -> (a, c) -> (b, d)



More information about the ghc-commits mailing list