Skip to content

Instantly share code, notes, and snippets.

@zaneli
Created September 17, 2016 02:26
Show Gist options
  • Save zaneli/8fb5edc71ffd19c0433b350ce8fcd2ff to your computer and use it in GitHub Desktop.
Save zaneli/8fb5edc71ffd19c0433b350ce8fcd2ff to your computer and use it in GitHub Desktop.
Haskell Day 2016 演習
#!/usr/bin/env stack
-- stack --install-ghc runghc --package turtle
import Turtle
main = hostname >>= echo
#!/usr/bin/env stack
-- stack --install-ghc runghc --package turtle
import Turtle
main = do
as <- arguments
d <- datefile $ fromText $ head as
echo $ repr d
#!/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
#!/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