Skip to content

Commit 4efe8c2

Browse files
authored
Merge pull request #3981 from phadej/fix-gen-extra-sources
Fix gen-extra-source-files.hs
2 parents f4969a0 + f50153b commit 4efe8c2

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Cabal/misc/gen-extra-source-files.hs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ getOtherModulesFiles :: GenericPackageDescription -> [FilePath]
6666
getOtherModulesFiles gpd = mainModules ++ map fromModuleName otherModules'
6767
where
6868
testSuites :: [TestSuite]
69-
testSuites = map (foldCondTree . snd) (condTestSuites gpd)
69+
testSuites = map (foldMapCondTree id . snd) (condTestSuites gpd)
7070

7171
mainModules = concatMap (mainModule . testInterface) testSuites
7272
otherModules' = concatMap (otherModules . testBuildInfo) testSuites
@@ -104,11 +104,11 @@ strictReadFile fp = do
104104
where
105105
get h = IO.hGetContents h >>= \s -> length s `seq` return s
106106

107-
foldCondTree :: Monoid a => CondTree v c a -> a
108-
foldCondTree (CondNode x _ cs)
109-
= mappend x
110-
-- list, 3-tuple, maybe
111-
$ (foldMap . foldMapTriple . foldMap) foldCondTree cs
107+
foldMapCondTree :: Monoid m => (a -> m) -> CondTree v c a -> m
108+
foldMapCondTree f (CondNode x _ cs)
109+
= mappend (f x)
110+
-- list, 3-tuple+maybe
111+
$ (foldMap . foldMapTriple . foldMapCondTree) f cs
112112
where
113-
foldMapTriple :: (c -> x) -> (a, b, c) -> x
114-
foldMapTriple f (_, _, x) = f x
113+
foldMapTriple :: Monoid x => (b -> x) -> (a, b, Maybe b) -> x
114+
foldMapTriple f (_, x, y) = mappend (f x) (foldMap f y)

0 commit comments

Comments
 (0)