[commit: ghc] wip/nfs-locking: Fit lines into 80 characters. (d956739)

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


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

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

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

commit d956739dd5d551fa4f0259966f2f0b0cce250bcd
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Jan 11 21:42:39 2015 +0000

    Fit lines into 80 characters.


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

d956739dd5d551fa4f0259966f2f0b0cce250bcd
 src/Oracles/PackageData.hs | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/src/Oracles/PackageData.hs b/src/Oracles/PackageData.hs
index ba63612..6bffafd 100644
--- a/src/Oracles/PackageData.hs
+++ b/src/Oracles/PackageData.hs
@@ -12,21 +12,25 @@ import Util
 newtype PackageDataKey = PackageDataKey (FilePath, String)
                         deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
 
-data PackageData = Modules FilePath | SrcDirs FilePath | PackageKey FilePath 
-                 | IncludeDirs FilePath | Deps FilePath | DepKeys FilePath
+data PackageData = Modules     FilePath
+                 | SrcDirs     FilePath
+                 | PackageKey  FilePath
+                 | IncludeDirs FilePath
+                 | Deps        FilePath
+                 | DepKeys     FilePath
 
 instance ShowArgs PackageData where
-    showArgs key = do
-        let (keyName, file, ifEmpty) = case key of
+    showArgs packageData = do
+        let (key, file, defaultValue) = case packageData of
                Modules     file -> ("MODULES"     , file, "" )
                SrcDirs     file -> ("HS_SRC_DIRS" , file, ".")
                PackageKey  file -> ("PACKAGE_KEY" , file, "" )
                IncludeDirs file -> ("INCLUDE_DIRS", file, ".")
                Deps        file -> ("DEPS"        , file, "" )
                DepKeys     file -> ("DEP_KEYS"    , file, "" )
-            keyFullName = replaceSeparators '_' $ takeDirectory file ++ "_" ++ keyName
-        res <- askOracle $ PackageDataKey (file, keyFullName)
+            fullKey = replaceSeparators '_' $ takeDirectory file ++ "_" ++ key
+        res <- askOracle $ PackageDataKey (file, fullKey)
         return $ words $ case res of
-            Nothing    -> error $ "\nCannot find key '" ++ keyName ++ "' in " ++ file ++ "."
-            Just ""    -> ifEmpty
+            Nothing    -> error $ "No key '" ++ key ++ "' in " ++ file ++ "."
+            Just ""    -> defaultValue
             Just value -> value



More information about the ghc-commits mailing list