[GHC] #12187: Clarify the scoping of existentials for pattern synonym signatures

GHC ghc-devs at haskell.org
Sun Jun 12 10:24:56 UTC 2016


#12187: Clarify the scoping of existentials for pattern synonym signatures
-------------------------------------+-------------------------------------
           Reporter:  mpickering     |             Owner:
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
  PatternSynonyms                    |
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:  #12108
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 What are scoping rules for type variables in pattern synonym signatures?

 We said that existentials variables are scoped as follows:

 1. Existentials scope over only the provided constraints and the
 arguments, not over the result type.


 {{{
 type Disguised a b = b -> RP a
 pattern Q :: () => Eq b => Disguised a b
 }}}

 However, Simon argues that `Q` should be accepted as if we expand the
 type synonym then the existentially quantified `b` is no longer in the
 result type.

 Richard disagrees, he considers the result type to be `Disguised a b` and
 so `b` is in the result type and not in-scope. Therefore he wishes to
 reject this example.

 The purpose of this ticket is to decide the fate of `Q`.

 This kind of problem is related to #12108

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


More information about the ghc-tickets mailing list