[GHC] #15828: Type family equation foralls allow strange re-quantification of class-bound type variables

GHC ghc-devs at haskell.org
Mon Oct 29 15:07:43 UTC 2018


#15828: Type family equation foralls allow strange re-quantification of class-bound
type variables
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.7
      Resolution:                    |             Keywords:  TypeFamilies
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by mayac):

 I also agree `C1` should be rejected, though I'm quite baffled by why that
 is currently not the case. It appears that the two `a`s in the `C1`
 example truly do have the same name post-`GhcRn`. Shouldn't
 `bindLHsTyVarBndrs` be coming up with a fresh name for each explicitly
 quantified type variable anyway? I don't think I understand enough about
 the way GHC comes up with new names to see where this goes wrong...

 In response to @goldfire, I would be happy to address these things as they
 come up! Of course, if someone finds a fix faster than I do they should
 feel free to go ahead with the change. In this case, I would need some
 guidance as I expressed above.

 As for the documentation, how about the following:
 > When an explicit `forall` is present, all ''type'' variables mentioned
 which are not already in scope must be bound by the `forall`.

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15828#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list