Last active
October 26, 2017 11:38
-
-
Save deque-blog/eee7927a8c56b76b554a5eaf80ee1c78 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
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