summaryrefslogtreecommitdiff
path: root/hadrian/src/Rules/Gmp.hs
diff options
context:
space:
mode:
authorsheaf <sam.derbyshire@gmail.com>2022-11-18 19:11:46 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-01-16 20:48:57 -0500
commit33b58f77d2dd2bf17cd5fbfc3c06c8b2c44f5181 (patch)
tree5b293a1957cb988b0d0394824f1ff8696e25dc70 /hadrian/src/Rules/Gmp.hs
parent7a9a10423324864a2ce5d9c7e714a1045afd5153 (diff)
downloadhaskell-33b58f77d2dd2bf17cd5fbfc3c06c8b2c44f5181.tar.gz
Hadrian: generalise &%> to avoid warnings
This patch introduces a more general version of &%> that works with general traversable shapes, instead of lists. This allows us to pass along the information that the length of the list of filepaths passed to the function exactly matches the length of the input list of filepath patterns, avoiding pattern match warnings. Fixes #22430
Diffstat (limited to 'hadrian/src/Rules/Gmp.hs')
-rw-r--r--hadrian/src/Rules/Gmp.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/hadrian/src/Rules/Gmp.hs b/hadrian/src/Rules/Gmp.hs
index 985f13ef29..f6222a6643 100644
--- a/hadrian/src/Rules/Gmp.hs
+++ b/hadrian/src/Rules/Gmp.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE GADTs #-}
+
module Rules.Gmp (gmpRules, gmpBuildPath, gmpObjects) where
import Base
@@ -96,7 +98,8 @@ gmpRules = do
-- - <root>/stageN/gmp/gmp.h
-- - <root>/stageN/gmp/libgmp.a
-- - <root>/stageN/gmp/objs/*.o (unpacked objects from libgmp.a)
- [gmpPath -/- "libgmp.a", gmpPath -/- "gmp.h"] &%> \[lib,header] -> do
+ (gmpPath -/- "libgmp.a" :& gmpPath -/- "gmp.h" :& Nil) &%>
+ \( lib :& header :& _) -> do
let gmpP = takeDirectory lib
ctx <- makeGmpPathContext gmpP
-- build libgmp.a via gmp's Makefile
@@ -133,7 +136,8 @@ gmpRules = do
-- Extract in-tree GMP sources and apply patches. Produce
-- - <root>/stageN/gmp/gmpbuild/Makefile.in
-- - <root>/stageN/gmp/gmpbuild/configure
- [gmpPath -/- "gmpbuild/Makefile.in", gmpPath -/- "gmpbuild/configure"] &%> \[mkIn,_] -> do
+ (gmpPath -/- "gmpbuild/Makefile.in" :& gmpPath -/- "gmpbuild/configure" :& Nil)
+ &%> \( mkIn :& _ ) -> do
top <- topDirectory
let gmpBuildP = takeDirectory mkIn
gmpP = takeDirectory gmpBuildP