contents :: FilePath -> IO [FilePath]
contents fp =
    filter notSpecial `fmap` (getDirectoryContents fp `catchIO` (\_ -> return []))
  where
    notSpecial :: String -> Bool
    notSpecial n = not $ n `elem` [".", ".."]

-- | Entries under a directory. Like contents, but with the dir path prepended.
contents :: FilePath -> IO [FilePath]
contents fp =
    filter notSpecial `fmap` (getDirectoryContents fp `catchIO` (\_ -> return []))
  where
    notSpecial :: String -> Bool
    notSpecial n = not $ n `elem` [".", ".."]

-- | Entries under a directory. Like contents, but with the dir path prepended.
contents fp =
    filter notSpecial `fmap` (getDirectoryContents fp `catchIO` (\_ -> return []))
  where
    notSpecial :: String -> Bool
    notSpecial n = not $ n `elem` [".", ".."]

-- | Entries under a directory. Like contents, but with the dir path prepended.