patch applied (ghc-7.0/ghc): Use "on the spot" solving for fundeps

Ian Lynagh igloo at earth.li
Fri Feb 18 15:46:07 CET 2011


Thu Feb 17 06:09:21 PST 2011  simonpj at microsoft.com
  * Use "on the spot" solving for fundeps
  
  When we spot an equality arising from a functional dependency,
  we now use that equality (a "wanted") to rewrite the work-item
  constraint right away.  This avoids two dangers
  
   Danger 1: If we send the original constraint on down the pipeline
             it may react with an instance declaration, and in delicate
  	   situations (when a Given overlaps with an instance) that
  	   may produce new insoluble goals: see Trac #4952
  
   Danger 2: If we don't rewrite the constraint, it may re-react
             with the same thing later, and produce the same equality
             again --> termination worries.
  
  To achieve this required some refactoring of FunDeps.lhs (nicer
  now!).  
  
  This patch also contains a couple of unrelated improvements
  
  * A bad bug in TcSMonad.nestImplicTcS whereby the Tcs tyvars
    of an outer implication were not untouchable inside
  
  * Improved logging machinery for the type constraint solver;
    use -ddump-cs-trace (probably with a wider default line width
    -dppr-cols=200 or something)

    M ./compiler/main/DynFlags.hs +2
    M ./compiler/typecheck/TcCanonical.lhs -2 +76
    M ./compiler/typecheck/TcInteract.lhs -134 +199
    M ./compiler/typecheck/TcRnTypes.lhs -4 +3
    M ./compiler/typecheck/TcSMonad.lhs -70 +44
    M ./compiler/types/FunDeps.lhs -116 +173

View patch online:
http://darcs.haskell.org/cgi-bin/darcsweb.cgi?r=ghc-7.0/ghc;a=darcs_commitdiff;h=20110217140921-1287e-f878db8292928b16ec00e7dd296d0b15547b21bd.gz



More information about the Cvs-ghc mailing list