Yeah, that's what my second gripe was meant to complain about. Really,
withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r
is just a more general way of writing withFile :: FilePath -> IOMode -> (Handle -> IO Handle) -> IO Handle
;)I've also heard about the ResourceT monad transformer but as of right now I don't think I could explain what it does or judge how well it does it, maybe that's also a sufficient solution.