From 33b58f77d2dd2bf17cd5fbfc3c06c8b2c44f5181 Mon Sep 17 00:00:00 2001 From: sheaf Date: Fri, 18 Nov 2022 19:11:46 +0100 Subject: 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 --- hadrian/src/Rules/Gmp.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'hadrian/src/Rules/Gmp.hs') 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 -- - /stageN/gmp/gmp.h -- - /stageN/gmp/libgmp.a -- - /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 -- - /stageN/gmp/gmpbuild/Makefile.in -- - /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 -- cgit v1.2.1