[GHC] #4894: Missing improvement for fun. deps.

GHC cvs-ghc at haskell.org
Mon Jan 17 23:27:21 CET 2011


#4894: Missing improvement for fun. deps.
----------------------------------------+-----------------------------------
    Reporter:  diatchki                 |        Owner:              
        Type:  bug                      |       Status:  new         
    Priority:  normal                   |    Milestone:              
   Component:  Compiler (Type checker)  |      Version:  7.1         
    Keywords:                           |     Testcase:              
   Blockedby:                           |   Difficulty:              
          Os:  Unknown/Multiple         |     Blocking:              
Architecture:  Unknown/Multiple         |      Failure:  None/Unknown
----------------------------------------+-----------------------------------

Comment(by diatchki):

 I was thinking that each FD for a class, F, would correspond to a
 built-in rule of the form:
 {{{
 ByFD F 0 :: (F a b, F a c) => (b ~ c)
 ...
 ByFD F n :: ...
 }}}
 and we'd use these rules to reason about FDs.  The rules would work both
 for givens (in which case they'd generate new facts), and for wanteds
 (in which case they'd generate new goals).  As far as I understand, there
 would be no need for any special "improvement" code because everything
 would be handled by the code for reasoning about equality.  Furthermore,
 we'd have a record of where FD-improvement kicked in, for sanity checking
 purposes.

 We ensure that the rule is valid by rejecting instances that might violate
 it.
 This is essentially the same as checking that the instances of a type
 family
 are consistent with each other, which is why we can conclude that
 {{{(B a ~ b, B a ~ c) => b ~ c}}}.

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



More information about the Glasgow-haskell-bugs mailing list