Created
August 22, 2017 11:46
-
-
Save arianvp/4ad59068b0baa02d5b56c9725627c064 to your computer and use it in GitHub Desktop.
This file contains 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.IO.Class | |
import Control.Monad.Codensity | |
import System.IO | |
managedActions :: Codensity IO () | |
managedActions = do | |
input <- Codensity $ withFile "in.txt" ReadMode | |
output <- Codensity $ withFile "out.txt" WriteMode | |
contents <- liftIO $ hGetContents input | |
liftIO $ hPutStr output contents | |
main :: IO () | |
main = do | |
lowerCodensity managedActions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment