Advertisement
Peaser

sad

Feb 16th, 2015
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $ ghci
  2. GHCi, version 7.8.4: http://www.haskell.org/ghc/  :? for help
  3. Prelude> :set prompt "> "
  4. > import Control.Applicative
  5. > import Control.Monad
  6. > :set -XOverloadedStrings
  7. > import Data.Text
  8. > import Data.Text.IO
  9. > import Prelude hiding (getLine, putStrLn)
  10. > let ask = putStrLn "Are you sad?" >> isPrefixOf "y" <$> getLine
  11. > let stop = putStrLn "Stop!"
  12. > let beAwesome = putStrLn "Be awesome!"
  13. > sad <- ask
  14. Are you sad?
  15. yeah
  16. > when sad (stop >> beAwesome)
  17. Stop!
  18. Be awesome!
  19. >
  20. Leaving GHCi.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement