Changeset 14128 for src/Pugs/Eval

Show
Ignore:
Timestamp:
10/09/06 17:26:46 (2 years ago)
Author:
audreyt
Message:

* Pugs.Eval.Var: In multi-dispatch, bias toward things with

longer parameter lists, even though the type distance is
otherwise equivalent:

multi f (Any *@) {...}
multi f (Any $) {...} # This always wins on 1arg case

Previously the *@ case will win, which was utterly bogus.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Eval/Var.hs

    r14113 r14128  
    333333            deltaArgs   <- mapM deltaFromPair pairs 
    334334            let bound = either (const False) (const True) $ bindParams sub _invs _args 
    335             return ((isMulti sub, bound, sum deltaArgs, deltaCxt), fun) 
     335            return ((isMulti sub, bound, -(length deltaArgs), sum deltaArgs, deltaCxt), fun) 
    336336 
    337337    -- findBuiltinSub :: (_var :: Var, _invs :: Maybe Exp, _args :: [Exp])