I\'ve written a small Haskell program to print the MD5 checksums of all files in the current directory (searched recursively). Basically a Haskell version of md5deep>
Edit: my assumption was that the user was opening thousands of very small files, it turns out they are very large. Laziness will be essential.
Well, you'll need to use a different IO mechanism. Either:
I'd also strongly recommend not using 'unpack', as that destroys the benefit of using bytestrings.
For example, you can replace your lazy IO with System.IO.Strict, yielding:
import qualified System.IO.Strict as S
getList :: FilePath -> IO [String]
getList p = mapM getFileLine =<< getRecursiveContents p
where
getFileLine path = liftM (\c -> (hex (hash c)) ++ " " ++ path)
(S.readFile path)