From 611ec635c90f8b73dd6a0ebd871eece3c3e76b2c Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Mon, 26 Mar 2018 12:49:31 +0200 Subject: Get rid of foldMap for older GHC --- src/Init.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Init.hs b/src/Init.hs index 25a2096..aee3f0c 100644 --- a/src/Init.hs +++ b/src/Init.hs @@ -66,17 +66,16 @@ main = do createCabal cabalPath name fs -> do putStrLn $ "The following files will be overwritten:" - foldMap putStrLn fs + mapM_ putStrLn fs putStrLn $ "Use -f to overwrite them" exitFailure existingFiles :: FilePath -> [FilePath] -> IO [FilePath] -existingFiles dstDir = foldMap $ \file -> do +existingFiles dstDir files = fmap concat $ forM files $ \file -> do let dst = dstDir file exists <- doesFileExist dst return $ if exists then [dst] else [] - -- | Figure out a good cabal package name from the given (existing) directory -- name makeName :: FilePath -> IO String -- cgit v1.2.3