[GHC] #8779: Exhaustiveness checks for pattern synonyms
GHC
ghc-devs at haskell.org
Fri Jan 6 14:38:30 UTC 2017
#8779: Exhaustiveness checks for pattern synonyms
-------------------------------------+-------------------------------------
Reporter: nomeata | Owner: mpickering
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 7.8.1
checker) | Keywords:
Resolution: | PatternSynonyms
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): Phab:D2669
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by mpickering):
To respond to an earlier point that Reid and others have made. The
potential problems with this pragma only highlight design compromises with
pattern synonyms. The specific issue being that pattern synonyms are ad-
hoc collections rather than a complete set of covering patterns.
Reid's suggestion of improving exhaustiveness checking by seeing if the
view function is injective is akin to suggesting that one should only be
allowed to define complete sets of pattern synonyms in the first place.
I see the design I have implemented as the sensible way of doing so. If we
forced all users to write pattern synonyms in the way that Reid described
then we would have been better off implementing views!
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8779#comment:45>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list