import Directory myVisit :: String -> IO [String] myVisit path = do isFile <- doesFileExist path isDirectory <- doesDirectoryExist path print path if (path == ".") || (path == "..") then return  else if isFile then return [path] else if isDirectory then do unfilteredContents x /= "." && x /= "..") unfilteredContents visitedDirectories <- mapM myVisit (map ((path ++ "/") ++) contentList) return (concat visitedDirectories) else return 
This code is the result of spending some good hours in the middle of the night, with lots of input from the very patient guys on the #haskell channel from irc.freenode.net. Very interesting are the bugs of the code and what happens in functions using this code. This Haskell really puts me to work. But that next time.