
#8779: Exhaustiveness checks for pattern synonyms -------------------------------------+------------------------------------- Reporter: nomeata | Owner: 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): Wiki Page: | -------------------------------------+------------------------------------- Comment (by rwbarton): You can define `SnocNil` via the same view (e.g. `viewr -> EmptyR`), then from my last bullet point GHC will see that the patterns are exhaustive. There will certainly be other holes in the scheme though. Even if we had `COMPLETE_PATTERNS`, I would still expect GHC to be able to handle expanding pattern synonyms to their definitions and collecting view patterns with the same view without any help from `COMPLETE_PATTERNS` pragmas; and then I don't see much additional value in the pragma to justify its implementation given its limitations. I could get behind a more comprehensive solution, though I don't know what it would look like. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8779#comment:33 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler