[commit: ghc] wip/nfs-locking: Add Haddock comments in Predicates.hs (de634da)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:30:55 UTC 2017


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

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

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

commit de634dadaf365799b3e0b8945ec812b2bec37c74
Author: David Luposchainsky <dluposchainsky at gmail.com>
Date:   Wed Jan 6 14:31:37 2016 +0100

    Add Haddock comments in Predicates.hs


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

de634dadaf365799b3e0b8945ec812b2bec37c74
 src/Predicates.hs | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/src/Predicates.hs b/src/Predicates.hs
index ad63598..b5ce0cb 100644
--- a/src/Predicates.hs
+++ b/src/Predicates.hs
@@ -7,49 +7,60 @@ module Predicates (
 import Base
 import Expression
 
--- Basic predicates
+-- | Is the build currently in the provided stage?
 stage :: Stage -> Predicate
 stage s = fmap (s ==) getStage
 
+-- | Is a particular package being built?
 package :: Package -> Predicate
 package p = fmap (p ==) getPackage
 
--- For unstaged builders, e.g. GhcCabal
+-- | Is an unstaged builder is being used such as /GhcCabal/?
 builder :: Builder -> Predicate
 builder b = fmap (b ==) getBuilder
 
--- For staged builders, e.g. Ghc Stage
+-- | Is a certain builder used in the current stage?
 stagedBuilder :: (Stage -> Builder) -> Predicate
-stagedBuilder sb = (builder . sb) =<< getStage
+stagedBuilder stageBuilder = do
+    s <- getStage
+    builder (stageBuilder s)
 
+-- | Are we building with GCC?
 builderGcc :: Predicate
 builderGcc = stagedBuilder Gcc ||^ stagedBuilder GccM
 
+-- | Are we building with GHC?
 builderGhc :: Predicate
 builderGhc = stagedBuilder Ghc ||^ stagedBuilder GhcM
 
+-- | Does any of the output files match a given pattern?
 file :: FilePattern -> Predicate
 file f = fmap (any (f ?==)) getOutputs
 
+-- | Is the current build 'Way' equal to a certain value?
 way :: Way -> Predicate
 way w = fmap (w ==) getWay
 
--- Derived predicates
+-- | Is the build currently in stage 0?
 stage0 :: Predicate
 stage0 = stage Stage0
 
+-- | Is the build currently in stage 1?
 stage1 :: Predicate
 stage1 = stage Stage1
 
+-- | Is the build currently in stage 2?
 stage2 :: Predicate
 stage2 = stage Stage2
 
+-- | Is the build /not/ in stage 0 right now?
 notStage0 :: Predicate
 notStage0 = notM stage0
 
+-- | Is a certain package /not/ built right now?
 notPackage :: Package -> Predicate
 notPackage = notM . package
 
--- TODO: Actually, we don't register compiler in some circumstances -- fix.
+-- | TODO: Actually, we don't register compiler in some circumstances -- fix.
 registerPackage :: Predicate
 registerPackage = return True



More information about the ghc-commits mailing list