[GHC] #9242: Implement {-# OVERLAPPABLE #-} and {-# INCOHERENT #-} pragmas

GHC ghc-devs at haskell.org
Sun Jul 27 18:14:54 UTC 2014


#9242: Implement {-# OVERLAPPABLE #-} and {-# INCOHERENT #-} pragmas
-------------------------------------+-------------------------------------
              Reporter:  simonpj     |            Owner:  diatchki
                  Type:  feature     |           Status:  new
  request                            |        Milestone:
              Priority:  normal      |          Version:  7.8.2
             Component:  Compiler    |         Keywords:
            Resolution:              |     Architecture:  Unknown/Multiple
      Operating System:              |       Difficulty:  Unknown
  Unknown/Multiple                   |       Blocked By:
       Type of failure:              |  Related Tickets:
  None/Unknown                       |
             Test Case:              |
              Blocking:              |
Differential Revisions:              |
-------------------------------------+-------------------------------------

Comment (by diatchki):

 As I started implementing this, it occurred to me that another
 interpretation of `OVERLAPPING` and `OVERLAPPABLE` is also possible:
   * `OVERLAPPING`:
      - may replace ''any'' more general instance;
      - may be replaced by more specific instances marked with
 `OVERLAPPING`.
   * `OVERLAPABLE`:
      - may be replaced by ''any'' more specific instance;
      - may replace more general instances marked with `OVERLAPABLE`.

 This interpretation has the advantage of specifying how to interact with
 "normal" instances (i.e., ones compiled in modules without special
 overlapping flags).  The drawback is that there is no way for an instance
 to be sure that it won't be replaced.  Perhaps that's OK though---I think
 the current system does not provide a way to do this anyway.

 See also #3877 for some related discussuion.

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


More information about the ghc-tickets mailing list