Merge branch monad-comp onto master
authorSimon Peyton Jones <simonpj@microsoft.com>
Wed, 4 May 2011 15:37:08 +0000 (16:37 +0100)
committerSimon Peyton Jones <simonpj@microsoft.com>
Wed, 4 May 2011 15:37:08 +0000 (16:37 +0100)
This patch implements monad comprehensions, Trac #4370.
Thanks to Nils Schweinsberg for doing most of the heavy lifting.

I did quite a lot of related refactoring as well.  Notably:

* Combined TransformStmt and GroupStmt into a single
  constructor TransStmt; they share a lot of code.
  I also made TransStmt into a record; it has a lot of fields.

* Remove the "result expression" field of HsDo, and instead
  implement LastStmt, which is expected to be at the end
  of a list of Stmts

* Generalise and tidy up the typechecking of monad comprehensions

* Do-notation in arrows is marked with HsStmtContext = ArrowExpr

* tcMDoStmt (which was only used for arrows) is moved
  to TcArrows, and renamed tcArrDoStmt

* Improved documentation in the user manual

* Lots of other minor changes

1  2 
compiler/deSugar/Check.lhs

Simple merge