#7395: DefaultSignatures conflict with default implementations
----------------------------------+-----------------------------------------
    Reporter:  cgaebel            |       Owner:                           
        Type:  bug                |      Status:  new                      
    Priority:  normal             |   Milestone:                           
   Component:  Compiler           |     Version:  7.6.1                    
    Keywords:  DefaultSignatures  |          Os:  Unknown/Multiple         
Architecture:  Unknown/Multiple   |     Failure:  GHC rejects valid program
  Difficulty:  Unknown            |    Testcase:                           
   Blockedby:                     |    Blocking:                           
     Related:                     |  
----------------------------------+-----------------------------------------

Comment(by simonpj):

 OK I see. You want the choice to depend on attempting (and perhapes
 failing) solve the context of generic default.

 A related and oft-made request is to allow, say
 {{{
 instance Foo1 a => Bar (T a) where ...
 instance Foo2 a => Bar (T a) where ...
 }}}
 The request is that when soliving `(Bar (T Int))`, say, the compiler
 should try to solve `(Foo1 Int)` and `(Foo2 Int)` and pick the one that
 works.

 This is a big deal; it'd require some kind of back-tracking in the
 constraint solver.  Your suggestion is, I think, more modest but stll very
 far from straightforwward.  For example in your code, suppose you had
 {{{
 instance Foo a => Klass (T a)
 }}}
 Now, whether the context of the generic default is soluble may depend on
 the instantiation of a.

 Unless I'm missing something I'm not keen.

 Simon

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to