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

GHC ghc-devs at haskell.org
Tue May 9 18:47:39 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:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * related:   => #13672


Comment:

 Another example from #13672 which requires this functionality:

 {{{#!hs
 newtype Tannen f p a b = Tannen { runTannen :: f (p a b) }
 newtype Fix p a = In { out :: p (Fix p a) a }

 newtype ZipList a = ZL (Fix (Tannen Maybe (,)) a)

 pattern Nil :: ZipList a
 pattern Nil = ZL (In (Tannen Nothing))

 pattern (:::) :: a -> ZipList a -> ZipList a
 pattern a:::ZL as = ZL (In (Tannen (Just (as, a))))
 }}}

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


More information about the ghc-tickets mailing list