[GHC] #8582: Record syntax for pattern synonyms

GHC ghc-devs at haskell.org
Sat Mar 21 18:01:39 UTC 2015


#8582: Record syntax for pattern synonyms
-------------------------------------+-------------------------------------
        Reporter:  cactus            |                   Owner:  cactus
            Type:  feature request   |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  None/Unknown      |  Unknown/Multiple
      Blocked By:  5144              |               Test Case:
 Related Tickets:                    |                Blocking:
                                     |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by blamario):

 I just ran into this issue. I'm trying to generalize a legacy record type
 like

 {{{
 data Foo = Foo{bar :: String}
 }}}

 to

 {{{
 data GenFoo s = GenFoo{bar :: s}
 }}}

 Unfortunately there is no way to provide a backward-compatible interface
 after this change. I'm hoping with this feature the solution might be as
 simple as

 {{{
 type Foo = GenFoo String
 pattern Foo{bar} = GenFoo bar
 }}}

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


More information about the ghc-tickets mailing list