[GHC] #12203: Allow constructors on LHS of (implicit) bidirectional pattern synonym

GHC ghc-devs at haskell.org
Sat Jul 1 15:04:02 UTC 2017


#12203: Allow constructors on LHS of (implicit) bidirectional pattern synonym
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  low               |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |             Keywords:
      Resolution:                    |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13672            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Iceland_jack):

 Use case

 {{{#!hs
 data Pair a = a :# a

 pattern Pair1 :: Pair a -> (Bool -> a)
 pattern Pair1 (a :# a') <- (($ False) &&& ($ True) -> (a, a'))
   where Pair1 (a :# _)  False = a
         Pair1 (_ :# a') True  = a'
 }}}

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


More information about the ghc-tickets mailing list