Fun with Parallel Monad Comprehensions
In The Monad.Reader Issue 18 (Unreviewed article)
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.
Article and more information
- Download The Monad.Reader Issue 18, which contains the article (PDF)
- Download the article alone (PDF) or read it online
- See the samples from the article at Github
This is an unreviewed article, published in an online electronic magazine about Haskell. For more information about the magazine, see The Monad.Reader on Haskell wiki. To cite the article, use:
1: 2: 3: 4: 5: 6: 7:
Published: Sunday, 15 May 2011, 12:00 AM
Author: Tomas Petricek
Typos: Send me pull request!