User:Duplode/Apfelmus' loop for Control structures
From Wikibooks, open books for an open world
Explain, step by step, what the
loop action in the final box note does, and in particular what is the role of the
return (). Hints:
getCharis an action analogous to
getLine, except that, instead of taking a newline-terminated series of characters from the standard input and making a
IO String, it takes just a single character as soon as it is input.
- If you have trouble with the control flow within
loop, run it in GHCi to get a better feel of what it does.