September 11, 2026

Haskell for Hobos -- Do notation

-- this page is a place holder Do notation is somewhat of a internal sub-language within Haskell. Most people first encounter it in the context of IO. It works nicely there as a sort of sequential imperative sublanguage.

What is important to know is that it is really a way to deal with Monads. IO Actions are Monads, and that is why "do notation" is so useful there. However, "do notation" can be used in situations entirely apart from IO.

Some people criticize the existance of do notation, and for interesting reasons. The usual criticism is along the lines that it is a shortcut and as such both lures the novice into bad habits. Even worse it tends to breed a variety of misunderstandings. I don't have a dog in this fight. I think it is worth understanding this point of view, and in particular not to fall into the pitfalls that they point out.

Best of all, take a look at this classic essay:


Have any comments? Questions? Drop me a line!

Tom's software pages / tom@mmto.org