on master help sign in
Get rid of foldMap for older GHC
commit611ec635c90f8b73dd6a0ebd871eece3c3e76b2c authorJasper Van der Jeugt <m@jaspervdj.be> dateMon 26 Mar 2018, 12:49 (9 years ago) parentd9004ca
1 file changed+2−3
src/Init.hs+2−3
src/Init.hs+2−3
@@ -66,17 +66,16 @@ main = do
6666 createCabal cabalPath name
6767 fs -> do
6868 putStrLn $ "The following files will be overwritten:"
69− foldMap putStrLn fs
69+ mapM_ putStrLn fs
7070 putStrLn $ "Use -f to overwrite them"
7171 exitFailure
7272
7373existingFiles :: FilePath -> [FilePath] -> IO [FilePath]
74−existingFiles dstDir = foldMap $ \file -> do
74+existingFiles dstDir files = fmap concat $ forM files $ \file -> do
7575 let dst = dstDir </> file
7676 exists <- doesFileExist dst
7777 return $ if exists then [dst] else []
7878
79−
8079-- | Figure out a good cabal package name from the given (existing) directory
8180-- name
8281makeName :: FilePath -> IO String