Implement OVERLAPPING and OVERLAPPABLE pragmas (see #9242)
authorIavor S. Diatchki <iavor.diatchki@gmail.com>
Sun, 27 Jul 2014 20:02:37 +0000 (13:02 -0700)
committerIavor S. Diatchki <iavor.diatchki@gmail.com>
Sun, 27 Jul 2014 20:03:05 +0000 (13:03 -0700)
commit97f499b56c5888740ddb147fb198c28a3c06bac7
tree98a1dc54c41d79b0ecd5ec9f3c3ae2ee6bdfaa86
parent9487305393307d5eb34069c5821c11bb98b5ec90
Implement OVERLAPPING and OVERLAPPABLE pragmas (see #9242)

This also removes the short-lived NO_OVERLAP pragama, and renames
OVERLAP to OVERLAPS.

An instance may be annotated with one of 4 pragams, to control its
interaction with other overlapping instances:

  * OVERLAPPABLE:
    this instance is ignored if a more specific candidate exists

  * OVERLAPPING:
    this instance is preferred over more general candidates

  * OVERLAPS:
    both OVERLAPPING and OVERLAPPABLE (i.e., the previous GHC behavior).
    When compiling with -XOverlappingInstances, all instance are OVERLAPS.

  * INCOHERENT:
    same as before (see manual for details).
    When compiling with -XIncoherentInstances, all instances are INCOHERENT.
compiler/basicTypes/BasicTypes.lhs
compiler/hsSyn/HsDecls.lhs
compiler/parser/Lexer.x
compiler/parser/Parser.y.pp
compiler/typecheck/Inst.lhs
compiler/types/InstEnv.lhs
compiler/utils/Binary.hs
docs/users_guide/glasgow_exts.xml