[commit: ghc] wip/nfs-locking: Simplify using firstJustM (8933a3a)
git at git.haskell.org
git at git.haskell.org
Fri Oct 27 00:33:34 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/8933a3a8235a642638ef8e7e5e7c91777829535b/ghc
>---------------------------------------------------------------
commit 8933a3a8235a642638ef8e7e5e7c91777829535b
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Sun May 22 02:10:55 2016 +0100
Simplify using firstJustM
>---------------------------------------------------------------
8933a3a8235a642638ef8e7e5e7c91777829535b
src/Oracles/Dependencies.hs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/Oracles/Dependencies.hs b/src/Oracles/Dependencies.hs
index d6cdbd3..a458b6d 100644
--- a/src/Oracles/Dependencies.hs
+++ b/src/Oracles/Dependencies.hs
@@ -24,8 +24,7 @@ fileDependencies :: Context -> FilePath -> Action (FilePath, [FilePath])
fileDependencies context obj = do
let path = buildPath context -/- ".dependencies"
-- If no dependencies found, try to drop the way suffix (for *.c sources).
- deps <- listToMaybe . catMaybes <$>
- mapM (askOracle . ObjDepsKey . (,) path) [obj, obj -<.> "o"]
+ deps <- firstJustM (askOracle . ObjDepsKey . (,) path) [obj, obj -<.> "o"]
case deps of
Nothing -> error $ "No dependencies found for file " ++ obj
Just [] -> error $ "No source file found for file " ++ obj
More information about the ghc-commits
mailing list