Skip to content

Instantly share code, notes, and snippets.



Last active Oct 26, 2017
What would you like to do?
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