[GHC] #12001: RFC: Add pattern synonyms to base
GHC
ghc-devs at haskell.org
Mon May 2 01:09:21 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 ekmett):
I'm pretty much in the same camp as Joachim: The only one of these that I
think really passes muster as a pattern that models a constructor is
`Polar`.
It doesn't destroy information when you pattern match with it and then
reconstruct. (It does, however, destroy the phase information if the
magnitude is 0 if you construct then deconstruct).
The rest seem all better managed as view patterns, using existing
combinators so that their lossy nature is much more clear.
It is worthy of discussion to explore whether we're ready to start
incorporating patterns into the bulk of `base`, but I personally think I'd
like to see them endure a couple of releases without the sorts of major
overhauls they have going on with how to put signatures on them, etc.
before they started taking a more prominent role in a place where they'd
be as hard to dislodge as `base`.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12001#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list