Created
September 8, 2013 22:40
-
-
Save mmitou/6489165 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Control.Monad.Trans.Resource(runResourceT, allocate, release) | |
| import Control.Monad.IO.Class(liftIO) | |
| import System.IO | |
| printFile :: FilePath -> IO () | |
| printFile filePath = runResourceT $ do | |
| (releaseKey, resource) <- allocate (openFile filePath ReadMode) hClose | |
| liftIO (hGetContents resource >>= putStrLn) | |
| release releaseKey | |
| return () | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment