[GHC] #12428: Allow pattern synonyms to optionally carry coerceability

GHC ghc-devs at haskell.org
Sat Jul 23 17:45:11 UTC 2016


#12428: Allow pattern synonyms to optionally carry coerceability
-------------------------------------+-------------------------------------
           Reporter:  dfeuer         |             Owner:
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:  8.2.1
          Component:  Compiler       |           Version:  8.0.1
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Aside from their more interesting abilities, pattern synonyms can be used
 for name management. For example, if a module exports a type with a data
 constructor named `A`, and also re-exports a type with a data constructor
 named `A`, it can use a pattern synonym to rename the imported
 constructor. If the type is a `newtype`, this pattern synonym will not
 carry coerceability. Sometimes, this is exactly what one would desire (an
 "unsafe" module breaking through a newtype abstraction may wish to allow
 importers to confine coerceability). Other times, it's not (pattern
 synonym just for name control). When defining a pattern synonym for a type
 in a module in which that type is coerceable, it would be nice to be able
 to tell GHC that the pattern synonym should carry coerceability.

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


More information about the ghc-tickets mailing list