[GHC] #13349: Make GHC handle orphan COMPLETE sets of conlikes better

GHC ghc-devs at haskell.org
Tue Feb 28 16:06:48 UTC 2017


#13349: Make GHC handle orphan COMPLETE sets of conlikes better
-------------------------------------+-------------------------------------
           Reporter:  RyanGlScott    |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.1
           Keywords:                 |  Operating System:  Unknown/Multiple
  PatternSynonyms                    |
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 Like orphan rewrite rules, it's possible to define orphan `COMPLETE` sets.
 For instance:

 {{{#!hs
 module Foo where

 {-# COMPLETE False #-}
 }}}

 I suppose that we could define an orphan `COMPLETE` set as one that lives
 in a module where none of the conlikes are defined (or should we say
 "where one or more of the conlikes are not defined"? I'm not sure.)

 Like orphan `RULES`, orphan `COMPLETE` sets are important to track
 properly when transitively reading from interface files, as failing to
 bring an orphan `COMPLETE` set into scope could affect pattern-match
 exhaustivness warnings that users see.

 After discussing this with rwbarton and mpickering IRC, we decided that
 one of the two should happen:

 1. Treat orphan `COMPLETE` sets like orphan `RULES`. That is, mark a
 module as an orphan if it defines an orphan `COMPLETE` set, and thread a
 "`COMPLETE` pragma visibility" state through various places.
 2. Disallow orphan `COMPLETE` sets entirely.

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


More information about the ghc-tickets mailing list