#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 simonpj):
> I actually tried that, but I cannot typecheck that `((>>) . guard)`
function in the typechecker using `tcSyntaxOp` since it results in some
GHC panic error message on runtime. It's a bit difficult to reproduce
right now since it requires quite a few changes - but if you think the
exact error message would be helpful I can get it.
No, I wasn't clear enough. I meant:
* Typecheck `(>>)` using `tcSyntaxOp` just as you are doing now,
producing `e_bind`
* Ditto `guard`, producing `e_guard`
* Now construct the expression `(\x. e_bind (e_guard x))`, or `(e_bind .
e_guard)`, whichever is easier, and stick that in the `ExprStmt`. For the
latter you'll need to add the three type arguments to `(.)`.
Do not attempt to typecheck `((>>) . guard)`, because the programmer
didn't write that, and we don't want type error messages to mention that
program fragment.
Does that make more sense?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4370#comment:16>
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