You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.
It is not clear yet how trait dispatch should work. The current rules (which are mostly implemented) are:
a) find all matching traits
b) discriminate using subtraits, i.e. a subtrait will win over its supertrait
c) score all traits according to:
1 point for all single parameter traits,
2 points for all two parameter traits,
etc.
Now pick the highest scoring method.
d) if still ambiguous throw an error
a1) The base score is 1.0 + the maximum score of supertrait.
This is the dominant driver, assuming that each layer of trait inheritance adds a
significant notion of "specificity" to the match.
b2) each constraint in the trait definition, including the number of supertraits
(since it is just a constraint of istrait(SuperTr{X}) in disguise) would add
0.1 to the score.
c2) each number of parameters above 1 would add 0.01 to the score
We discussed the rules following #4 (comment) but let's continue this here.
The text was updated successfully, but these errors were encountered:
It is not clear yet how trait dispatch should work. The current rules (which are mostly implemented) are:
Over in PR #4 (comment) @tonyhffong suggested some new rules:
We discussed the rules following #4 (comment) but let's continue this here.
The text was updated successfully, but these errors were encountered: