[GHC] #8581: Add support for explicitly-bidirectional pattern synonyms

GHC ghc-devs at haskell.org
Tue Jul 8 12:42:46 UTC 2014


#8581: Add support for explicitly-bidirectional pattern synonyms
-------------------------------------+------------------------------------
        Reporter:  cactus            |            Owner:  cactus
            Type:  feature request   |           Status:  new
        Priority:  normal            |        Milestone:
       Component:  Compiler          |          Version:
      Resolution:                    |         Keywords:
Operating System:  Unknown/Multiple  |     Architecture:  Unknown/Multiple
 Type of failure:  None/Unknown      |       Difficulty:  Unknown
       Test Case:                    |       Blocked By:  5144
        Blocking:                    |  Related Tickets:
-------------------------------------+------------------------------------

Comment (by cactus):

 I have a working version of this in the `wip/pattern-synonyms` branch. It
 still needs some finishing (mostly, adding tests).

 The only difficult part of this work was ensuring that the following works
 (and is not regarded as a recursive pattern synonym):


 {{{
 pattern P x <- (x:_) where
   P x = foo [x]

 foo (P x) = [x, x]
 }}}

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


More information about the ghc-tickets mailing list