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

GHC ghc-devs at haskell.org
Fri Nov 30 00:45:25 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):  Phab:D5283
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ryan Scott <ryan.gl.scott@…>):

 In [changeset:"fe57a5bae3f8cb87637359f615c77f4afae86d46/ghc"
 fe57a5ba/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="fe57a5bae3f8cb87637359f615c77f4afae86d46"
 Fix #15828, from `More explicit foralls`

 Summary:
 Fix a bug in commit 12eeb9 which permits the following:

 ```
 class C a where
   type T a b
 instance C (Maybe a) where
   type forall a b. T (Maybe a) b = b
 ```

 where instead, the user should write:

 ```
 instance C (Maybe a) where
   type forall b. T (Maybe a) b = b
 ```

 Update the users guide to discuss scoping of type variables in
 explicit foralls in type family instances.

 Test Plan: validate

 Reviewers: bgamari, goldfire, monoidal

 Reviewed By: goldfire

 Subscribers: monoidal, rwbarton, carter

 GHC Trac Issues: #15828

 Differential Revision: https://phabricator.haskell.org/D5283
 }}}

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


More information about the ghc-tickets mailing list