I\'m getting comfortable with the idea of replacing loops with recursion. I\'m fiddling around with a pet project, and I wanted to test some text input functionality so I w
As I understand it you should forget about TCO: instead of asking whether a recursive call is in tail position, think in terms of guarded recursion. This answer I think has it right. You might also check out the post on Data and Codata from the always interesting and challenging "Neighborhood of Infinity" blog. Finally check out the Space Leak Zoo.
EDIT: I'm sorry the above doesn't address your question about monadic actions directly; I'm interested to see other answers like DanielWagner's that address the IO monad specifically.