[GHC] #1241: Functional dependency Coverage Condition is lifted, and should not be

GHC cvs-ghc at haskell.org
Mon Jan 14 01:30:27 CET 2013


#1241: Functional dependency Coverage Condition is lifted, and should not be
----------------------------------------+-----------------------------------
    Reporter:  guest                    |        Owner:                  
        Type:  bug                      |       Status:  new             
    Priority:  normal                   |    Milestone:  _|_             
   Component:  Compiler (Type checker)  |      Version:  6.6             
    Keywords:                           |           Os:  Unknown/Multiple
Architecture:  Unknown/Multiple         |   Difficulty:  Unknown         
    Testcase:                           |  
----------------------------------------+-----------------------------------

Comment(by iavor.diatchki@…):

 commit fe61599ffebb27924c4beef47b6237542644f3f4
 {{{
 Author: Iavor S. Diatchki <iavor.diatchki at gmail.com>
 Date:   Sun Jan 13 16:29:10 2013 -0800

     Use a version of the coverage condition even with
 UndecidableInstances.

     This fixes bug #1241 and #2247.  When UndecidableInstances are on,
     we use the "Liberal Coverage Condition", which is what GHC used to do
 in
     the past.  This is the gist of the check:

     class C a b | a -> b
     instance theta => C t1 t2

     we check that `fvs t2` is a subset of `fd-closure(theta,fvs t1)`.

     This is strictly more general than the coverage condition, while
     it still guarantees consistency with the FDs of the class.  This
     check is completely orthogonal to termination (it by no means
 guarantees
     it).

     I am not sure of the role of the "coverage condition" in
 termination---
     the comments suggest that it is important.  This is why, for the
 moment,
     we only use this check when UndecidableInstances are on.

  compiler/typecheck/TcValidity.lhs |    8 ++++-
  compiler/types/FunDeps.lhs        |   65
 ++++++++++++++++++++++++++++++++++++-
  2 files changed, 71 insertions(+), 2 deletions(-)
 }}}

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



More information about the ghc-tickets mailing list