#4370: Bring back monad comprehensions
---------------------------------+------------------------------------------
Reporter: simonpj | Owner: nsch
Type: feature request | Status: new
Priority: normal | Milestone: 7.2.1
Component: Compiler | Version: 6.12.3
Keywords: | Testcase:
Blockedby: | Difficulty:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by nsch):
Ok, I've been working on that a bit and have a couple of questions...
First, am I suppossed to use the existing `ExprStmt` for the last
statement of
a `HsDo` expression or add a separate `BodyStmt`? The reason I ask is that
those 2 other arguments to `ExprStmt` are pretty much redundant in our
body
context as we a) don't need (>>) anymore since we're already at the last
statements and b) always carry around the type of the expression anyway,
thus
needing no extra PostTcType (atleast I think so...). And in addition to
those
two points an extra `BodyStmt` would make it easier to distinguish the
`BodyStmt` from a usual `ExprStmt`.
Second question is about the typechecking/desugaring functions which don't
explicitely accept a `HsDo` expression. Currently they usually get 2
arguments,
the first one beeing the statements, the second one the body. Am I
supposed to
change these aswell, or will something like
{{{
-- compiler/typecheck/TcExpr.lhs
tcExpr (HsDo do_or_lc stmts _) res_ty
= tcDoStmts do_or_lc stmts' body res_ty
where (stmts', L _ (ExprStmt body _ _)) = (init stmts, last stmts)
}}}
be ok aswell?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4370#comment:25>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs