Skip to content

Instantly share code, notes, and snippets.

@slogsdon
Created April 4, 2015 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slogsdon/ad72fbeb54d572c9332a to your computer and use it in GitHub Desktop.
Save slogsdon/ad72fbeb54d572c9332a to your computer and use it in GitHub Desktop.
module Temp where
import System.Directory
path :: String
path = "/Users/shane.logsdon/Code/haskell/slogsdon.com/provider/posts/"
files :: IO [FilePath]
files = getDirectoryContents path
filterDirs :: [FilePath] -> [FilePath]
filterDirs = filter notCurrentPrevious
where
notCurrentPrevious f
| f `elem` [".", ".."] = False
| otherwise = True
getFilesContents :: [FilePath] -> IO [String]
getFilesContents = mapM (readFile . (path ++)) . filterDirs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment