#1241: Functional dependencies not checked.
-------------------------------------+--------------------------------------
 Reporter:  guest                    |          Owner:         
     Type:  bug                      |         Status:  new    
 Priority:  normal                   |      Milestone:  _|_    
Component:  Compiler (Type checker)  |        Version:  6.6    
 Severity:  normal                   |     Resolution:         
 Keywords:                           |     Difficulty:  Unknown
 Testcase:                           |   Architecture:  Unknown
       Os:  Unknown                  |  
-------------------------------------+--------------------------------------
Comment (by simonpj):

 Thanks Martin. I'd like your advice.  Here is GHC's spec for instance
 declarations

 [http://www.haskell.org/ghc/dist/current/docs/users_guide/other-type-
 extensions.html#instance-decls]

 Notice (1) the Paterson Conditions (PCs), (2) the Coverage Condition (CC)

 We agree that these conditions are conservative.  At the moment they are
 both lifted by adding -fallow-undecidable-instances.   But I gather you
 think that maybe the CC should *not* be lifted, is that right.

 So are you saying this?
         * The CC should always hold
         * The PCs can be lifted; the only problem is that you may get non-
 termination

 The trouble is, as you know, that sometimes the CC can validly not hold.
 Example:
 {{{
 class C a b | a->b
 class D a b | a->b
 instance D a b => C [a] [b]
 }}}
 Here the CC does not hold, but the context `(D a b)` enforces the
 dependency.  We call this the Weak Coverage condition in the paper.

 So you could be saying: you can only lift the CC if you replace it with a
 weaker, but still sufficiently strong alternative.

 I'm also not sure whether lifting it altogether (as GHC now does) is
 simply confusing, or whether it can be unsound or something really bad
 like that.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1241>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to