[GHC] #7828: RebindableSyntax and Arrow
GHC
ghc-devs at haskell.org
Mon Jun 16 13:17:21 UTC 2014
#7828: RebindableSyntax and Arrow
----------------------------------------------+----------------------------
Reporter: AlessandroVermeulen | Owner:
Type: bug | jstolarek
Priority: normal | Status: new
Component: Compiler (Type checker) | Milestone: 7.10.1
Resolution: | Version: 7.6.2
Operating System: Unknown/Multiple | Keywords:
Type of failure: GHC rejects valid program | Architecture:
Test Case: | Unknown/Multiple
Blocking: | Difficulty: Unknown
| Blocked By:
| Related Tickets: #1537,
| #3613
----------------------------------------------+----------------------------
Comment (by simonpj):
The VOODOO CODING is of course wrong. Take a look at the version for
`BindStmt` in (for example) `tcMcStmt`, in `TcMatches` line 511.
We are typechecking `pat <- rhs; body` as if it was `(>>=) rhs (\x ->
body)`. So we instantiate `(>>=)`, expecting its type to have the shape
{{{
rhs_ty -> (pat_ty -> body_ty)
}}}
That's what `tcSyntaxOp` does.
Then we check that `pat` really does have type `pat_ty` and `rhs` really
does have type `rhs_ty`.
Presumably you need to do similar things for arrows, but I'm not deep
enough into it to know how. Doing the instantiation once, at `CmdTop`
will almost certainly not work.
I'm sorry not to be more helpful.
Why not follow Ross's suggestions in comment 17?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/7828#comment:26>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list