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

GHC ghc-devs at haskell.org
Sat Jul 26 15:33:57 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):

 I know the code, so I don't mind doing it.   Out of curiosity, do you have
 an example of when you may want to write just `OVERLAPPING` and not
 `OVERLAPABLE` or vice versa?

 The way I understand it, they have the following meanings:
   * `OVERLAPPING` says "I am a most general instance" (i.e., can overlap,
 but can't be overlapped),
   * `OVERLAPABLE` says "I am a most specific instance" (i.e., can't
 overlap, can be overlapped).

 So, they make some sense for the "edge-case" instances, but not for the
 ones inbetween, and I couldn't really think of good cases where I may want
 to put them on an instance.

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


More information about the ghc-tickets mailing list