Skip to content

Commit

Permalink
Get rid of foldMap for older GHC
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspervdj committed Mar 26, 2018
1 parent d9004ca commit 611ec63
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Init.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 611ec63

Please sign in to comment.