[commit: ghc] wip/nfs-locking: Minor revision (3c5998c)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 01:00:49 UTC 2017


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

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

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

commit 3c5998cddf477e84ee2e0b98de7a7d26bb0da710
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun May 15 01:02:51 2016 +0100

    Minor revision


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

3c5998cddf477e84ee2e0b98de7a7d26bb0da710
 src/Oracles/PackageData.hs | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/Oracles/PackageData.hs b/src/Oracles/PackageData.hs
index ba3e205..dba1192 100644
--- a/src/Oracles/PackageData.hs
+++ b/src/Oracles/PackageData.hs
@@ -5,17 +5,10 @@ module Oracles.PackageData (
     ) where
 
 import Development.Shake.Config
-import Base
 import qualified Data.HashMap.Strict as Map
 
--- For each (PackageData path) the file 'path/package-data.mk' contains
--- a line of the form 'path_VERSION = 1.2.3.4'.
--- pkgData $ PackageData path is an action that consults the file and
--- returns "1.2.3.4".
---
--- PackageDataList is used for multiple string options separated by spaces,
--- such as 'path_MODULES = Data.Array Data.Array.Base ...'.
--- pkgListData Modules therefore returns ["Data.Array", "Data.Array.Base", ...]
+import Base
+
 data PackageData = BuildGhciLib FilePath
                  | ComponentId  FilePath
                  | Synopsis     FilePath
@@ -51,8 +44,10 @@ askPackageData path key = do
     case maybeValue of
         Nothing    -> return ""
         Just value -> return value
-        -- Nothing    -> putError $ "No key '" ++ key ++ "' in " ++ file ++ "."
 
+-- | For each @PackageData path@ the file 'path/package-data.mk' contains a line
+-- of the form 'path_VERSION = 1.2.3.4'. @pkgData (PackageData path)@ is an
+-- Action that consults the file and returns "1.2.3.4".
 pkgData :: PackageData -> Action String
 pkgData packageData = case packageData of
     BuildGhciLib path -> askPackageData path "BUILD_GHCI_LIB"
@@ -60,6 +55,9 @@ pkgData packageData = case packageData of
     Synopsis     path -> askPackageData path "SYNOPSIS"
     Version      path -> askPackageData path "VERSION"
 
+-- | @PackageDataList path@ is used for multiple string options separated by
+-- spaces, such as @path_MODULES = Data.Array Data.Array.Base ... at .
+-- @pkgListData Modules@ therefore returns ["Data.Array", "Data.Array.Base", ...]
 pkgDataList :: PackageDataList -> Action [String]
 pkgDataList packageData = fmap (map unquote . words) $ case packageData of
     CcArgs             path -> askPackageData path "CC_OPTS"
@@ -83,7 +81,7 @@ pkgDataList packageData = fmap (map unquote . words) $ case packageData of
   where
     unquote = dropWhile (== '\'') . dropWhileEnd (== '\'')
 
--- Oracle for 'package-data.mk' files
+-- | Oracle for 'package-data.mk' files.
 packageDataOracle :: Rules ()
 packageDataOracle = do
     keys <- newCache $ \file -> do



More information about the ghc-commits mailing list