[GHC] #12001: RFC: Add pattern synonyms to base

GHC ghc-devs at haskell.org
Sun May 1 18:28:04 UTC 2016


#12001: RFC: Add pattern synonyms to base
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  libraries/base    |              Version:  7.10.3
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by nomeata):

 I am very sceptical. Pattern synonyms are still relatively new, and I
 would say that best practices around them have not evolved yet (e.g.:
 should they be used for non-injective convenience patterns like `Popcount`
 at all? Should they be used for anything else but compatible or
 alternative views on data types?)

 Also, they clutter the namespace.

 Therefore, I would prefer if less central libraries would be first to take
 up pattern synonym and explore usage patterns, until it becomes apparent
 with which intensity pattern synonym make most sense.

 More concretely, of your list above, I’d give a +1 only to `Polar`. This
 is a genuine, self-descriptive constructor-like view on a data type. A bit
 fishy around 0, but that’s inherent in the general concept and not an
 issue with the constructor.

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


More information about the ghc-tickets mailing list