Skip to content

Instantly share code, notes, and snippets.

@deque-blog
Last active October 26, 2017 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deque-blog/eee7927a8c56b76b554a5eaf80ee1c78 to your computer and use it in GitHub Desktop.
Save deque-blog/eee7927a8c56b76b554a5eaf80ee1c78 to your computer and use it in GitHub Desktop.
echo : IO ()
echo = do
putStr "in> " -- Write "in> " in standard output
l <- getLine -- Read the standard input
when (l /= "quit") $ do -- Upon encountering something else than "quit"
putStrLn ("out> " ++ l) -- Echo the string in standard output
echo -- Recurse to loop again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment