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)
commit7028041739973c3dc17b23a98c65c892f41f0647
tree3b7cc20cf7744dfaee30df1e682dce69dcb8315d
parentaca4fde66f74bdb882e9151cd65ef8092246def1
parent5fca973afdf0d3bf593476af00dd5536dbc13dde
Merge branch monad-comp onto master

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
compiler/deSugar/Check.lhs