|
Monad comprehensions were added to the main GHC repository on the 4th May 2011. See ticket [\#4370](https://gitlab.haskell.org//ghc/ghc/issues/4370).
|
|
After a long absence, monad comprehensions are back, thanks to George Giorgidze and his colleagues. With `{-# LANGUAGE MonadComprehensions #-}` the comprehension `[ f x | x <- xs, x>4 ]` is interpreted in an arbitrary monad, rather than being restricted to lists. Not only that, it also generalises nicely for parallel/zip and SQL-like comprehensions. The aforementioned generalisations can be turned on by enabling the `MonadComprehensions` extension in conjunction with the `ParallelListComp` and `TransformListComp` extensions.
|