Skip to content

Instantly share code, notes, and snippets.

@deque-blog

deque-blog/echo_bad.idr

Last active Oct 26, 2017
Embed
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