Created
September 17, 2016 02:26
-
-
Save zaneli/8fb5edc71ffd19c0433b350ce8fcd2ff to your computer and use it in GitHub Desktop.
Haskell Day 2016 演習
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
#!/usr/bin/env stack | |
-- stack --install-ghc runghc --package turtle | |
import Turtle | |
main = hostname >>= echo |
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
#!/usr/bin/env stack | |
-- stack --install-ghc runghc --package turtle | |
import Turtle | |
main = do | |
as <- arguments | |
d <- datefile $ fromText $ head as | |
echo $ repr d |
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
#!/usr/bin/env stack | |
-- stack --install-ghc runghc --package turtle | |
import Turtle | |
main = do | |
as <- arguments | |
mapM echoModified as | |
echoModified :: MonadIO m => Text -> m () | |
echoModified filename = do | |
d <- datefile $ fromText $ filename | |
echo $ repr d |
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
#!/usr/bin/env stack | |
-- stack --install-ghc runghc --package turtle | |
import Turtle | |
main = do | |
x <- nestedIO | |
x | |
nestedIO :: IO (IO ()) | |
nestedIO = do | |
putStr "Hello, " | |
return (putStrLn "I/0!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment