
Chris Smith
This is a valid concern... assigning a meaning to values of IO types necessarily involves some very unsatisfying hand-waving about indeterminacy, since for example IO actions can distinguish between bottoms that are considered equivalent in the denotational semantics of pure values (you can catch a use of 'error', but you can't catch non-termination). Nevertheless, I'm satisfied that to the extent that any such meaning can be assigned, f will be a valid function on non-bottom values. Not perfect, but close.
Agree. The fact that IO actions can distinguish between bottoms, self-modify code, terminate non-terminable computations by rebooting the system, send killbots to the programmer's house and so on are extremely unsatisfying. That's IO for you. The dirty impure bottom comparison which uses IO, though, is available only to already impure functions.