[GHC] #14800: -Wincomplete-uni-patterns should not warn about explicitly-marked irrefutable patterns

GHC ghc-devs at haskell.org
Mon Feb 12 20:07:02 UTC 2018


#14800: -Wincomplete-uni-patterns should not warn about explicitly-marked
irrefutable patterns
-------------------------------------+-------------------------------------
           Reporter:  EyalLotem      |             Owner:  (none)
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.2.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 It is very useful to catch accidentally partial uni-pattern matches:

   Cons x = someVal

 However, we explicitly want an irrefutable pattern match:

   Vector2 0 y = Vector2 0 a `op` Vector2 0 b

 In this case, it would be really useful to opt out of the warning via:

   ~(Vector2 0 y) = ...

 The fact the match is partial is explicit and visible with the ~ syntax,
 so the warning shouldn't tell us about it.

 Right now this warning rules out this useful way of opting in to
 partiality.

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


More information about the ghc-tickets mailing list