Earlier quoted context omitted.
Short answer: No, you can't. Long answer: You can, but Haskell is very serious about keeping pure code separate from impure code. Any function which performs I/O is impure, so its output must be an IO Thing instead of just a Thing. This means anything that uses its output must accept an IO Thing instead of an ordinary Thing, and so on. Of course, the way I/O works means that a 'Type1 -> Type2' function into can be tr…
Whoa, really? You have to use a monad just to print text to stdout in Haskell?
If you don't care when it happens, you can use unsafePerformIO - which is just fine for debugging, though there are often better approaches.