Now, that you have started with Haskell, have you written a program doing IO yet, like reading a file or writing on the terminal? Then you have used the IO monad—but do you understand how it works? The standard explanation is, that the IO monad hides the non-functional IO actions —which do have side effects— from the functional world of Haskell. It prevents pollution of the functional programming style with side effects. However, since most beginning Haskell programmers (i.e., everyone I know and including me) lack knowledge about category theory, they have no clue about what a monad really is. Nor how this “hiding��? works, apart from having IO actions disappearing beyond the borders of our knowledge.
This report scratches the surface of category theory, an abstract branch of algebra, just deep enough to find the monad structure. On the way we discuss the relations to the purely functional programming language Haskell. Finally it should become clear how the IO monad keeps Haskell pure. We do not explain how to use the IO monad, nor discuss all the functions available to the programmer. But we do talk about the theory behind it.
Intended audience: Haskell programmers that stumbled across the IO monad, and now want to look under the hood. Haskell experience and the ability to read math formulae are mandatory.
|Name||CTIT Technical Report Series|
|Publisher||Centre for Telematica and Information Technology (CTIT)|