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

GHC ghc-devs at haskell.org
Tue Aug 26 10:58:26 UTC 2014


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

Comment (by simonpj):

 Question for mpickering.  How would it be if the pattern synonym had just
 ONE type, but it was the most constraining of the two directions.  Thus in
 your example,
 {{{
 pattern type Add a a :: (View a, Construct a) => a
 }}}
 rather than
 {{{
 pattern type Add a a :: (View a) => a
 }}}
 which is what we get from the pattern side, but which doesn't work on the
 expression side.

 The down-side is that pattern-matching would need a `(Construct a)`
 constraint that is not strictly necessary.  How bad would that be?

 Simon

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


More information about the ghc-tickets mailing list