Tomas Petricek

Monad comprehensions have an interesting history. They were the first syntactic extension for programming with monads. They were implemented in Haskell, but later replaced with plain list comprehensions and monadic do notation. Now, monad comprehensions are back in Haskell, more powerful than ever before!

Redesigned monad comprehensions generalize the syntax for working with lists. Quite interestingly, they also generalize syntax for zipping, grouping and ordering of lists. This article shows how to use some of the new expressive power when working with well-known monads. You'll learn what "parallel composition" means for parsers, a poor man's concurrency monad and an evaluation order monad.

 1: 2: 3: 4: 5: 6: 7: @other{comprefun, author = {Petricek, Tomas}, title = {{F}un with {P}arallel {M}onad {C}omprehensions}, howpublished = {Available online in {T}he {M}oand.{R}eader {I}ssue 18}, year = {2011}, url = {http://tomasp.net/academic/articles/comprefun/comprefun.pdf}, }