[commit: ghc] wip/nfs-locking: Fix MonadFail warning (a8cbd16)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 01:25:14 UTC 2017


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

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

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

commit a8cbd160e3e6b90bdb618620fd6eb4cc53179ae5
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sat Aug 19 16:21:27 2017 +0100

    Fix MonadFail warning


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

a8cbd160e3e6b90bdb618620fd6eb4cc53179ae5
 src/Settings/Builders/DeriveConstants.hs | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/Settings/Builders/DeriveConstants.hs b/src/Settings/Builders/DeriveConstants.hs
index b8846be..7a6e863 100644
--- a/src/Settings/Builders/DeriveConstants.hs
+++ b/src/Settings/Builders/DeriveConstants.hs
@@ -5,8 +5,11 @@ import Settings.Builders.Common
 -- TODO: do we need to support `includes_CC_OPTS += -DDYNAMIC_BY_DEFAULT`?
 deriveConstantsBuilderArgs :: Args
 deriveConstantsBuilderArgs = builder DeriveConstants ? do
-    cFlags                <- includeCcArgs
-    [outputFile, tempDir] <- getOutputs
+    cFlags <- includeCcArgs
+    outs   <- getOutputs
+    let (outputFile, tempDir) = case outs of
+            [a, b] -> (a, b)
+            _      -> error $ "DeriveConstants: expected two outputs, got " ++ show outs
     mconcat
         [ output "//DerivedConstants.h"             ? arg "--gen-header"
         , output "//GHCConstantsHaskellType.hs"     ? arg "--gen-haskell-type"



More information about the ghc-commits mailing list