[GHC] #15656: Extend -Wall with incomplete-uni-patterns and incomplete-record-updates

GHC ghc-devs at haskell.org
Sun Dec 9 20:41:41 UTC 2018


#15656: Extend -Wall with incomplete-uni-patterns and incomplete-record-updates
-------------------------------------+-------------------------------------
        Reporter:  ckoparkar         |                Owner:  (none)
            Type:  task              |               Status:  new
        Priority:  normal            |            Milestone:  8.8.1
       Component:  Compiler          |              Version:  8.4.3
      Resolution:                    |             Keywords:  GHCProposal
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RolandSenn):

 * owner:  RolandSenn => (none)


Comment:

 @ckoparkar, @RyanGlScott:
 Ops, this ticket contains more fun than I expected!

 Most of these ''incomplete patterns'' are already a very long time in the
 GHC and libraray code, so we can assume, they are nearly never a problem.
 The new warnings do not make the code safer or more unsafe. GHC now just
 reminds us, that there is unsafe code.

 To fix, we have 3 possibilities:

 1. Add a pragma to skip the warning to every affected module. This has the
 advantage, that we don't change the semantics of any GHC or library
 module.

 2. Add the missing patterns, and call panic! This has the advantage, that
 if we really ever hit such a case, the user gets a nicer error message,
 and is invited to report the problem.

 3. Add the missing patterns and add (maybe) intelligent code to the RHS of
 the pattern. This has the **disadvantage**, that we add a lot of code.
 Unfortunately will be unable to test this new code. This is very bad!

 I think, we should concentrate on option 1  or 2. The difference in the
 amount of work is marginal, however, I don't really know, which one is
 ''the GHC way'' to solve this issue. Ryan (and others!) please advice!

 Both solutions (1 and 2) are not difficult but a fair amount of work. We
 should only do it, if we know, that the solution will be accepted by code
 review.

 In addition we have to decide, who does the work: I don't mind to do
 everything, or just a part (libraries or GHC) or nothing.

 **The decisions are up to you! **

 PS: Till now I never did something in the libraries, so I'll probably need
 some guidance, eg how and where to specify the bumped version numbers of
 the modified libraries.

 PSS: Thanks to ckoparkar for the two attachments.

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


More information about the ghc-tickets mailing list