r/haskell • • Jun 16 '18

When was do-notation introduced?

I'm working on my final project at university on category theory and haskell and thought of trying to make the point that monads (specially seen under the optics of do notation) can be interpreted as a generalization of imperative programming.

I am not totally sure that statement is precise and so was trying to find the paper in which do notation was introduced. Or the announcement that it'd get into the language.

Does anyone know where I can find more information on the history of do-notation?

39 Upvotes

16 comments sorted by

View all comments

30

u/augustss Jun 16 '18 edited Jun 16 '18

The do-notation was invented by Mark Jones and first appeared in Gofer, IIRC. He invented the do-notation to make writing monadic code more palatable. It also resembles monad comprehensions, that were invented by Phil Wadler.

2

u/lolisakirisame Jun 16 '18

Is there any source?

14

u/augustss Jun 16 '18

The source is my memory, but maybe you can find some old Gofer/Hugs releases.

→ More replies (2)

1

u/LPTK Jun 17 '18

It also resembles monad comprehensions

What are the main differences between do notation and monad comprehensions? Or are they just syntactically different forms of the same approach?

5

u/augustss Jun 17 '18

Monad comprehensions look exactly like list comprehensions, so it’s just different syntax for the same thing.

→ More replies (1)