Make the type argument order in DA.Numeric explicit #5817
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
All functions in
DA.Numeric
take the scale of the result as theirfirst type argument. IMO, this is a nice API since you usually only
want to specify the scale of the result since the scale of the
term arguments is most of the times inferred.
However, the current type signatures in
DA.Numeric
bear quite somerisk of being confusing. For instance, in
the naming of the type variables suggests that the order of the
type parameters is
n1 n2 n3
when it actually isn3 n1 n2
.I consider the knowledge of implicit
forall
s are filled in quiteexpert and hence think we should make the order of these type arguments
explicit.
There is also a related mistake in the docs of
shift
. Running ascenario confirmed that
Hence,
shift
has multiplied its argument by10^(2-1)
, which is10^(n1 - n2)
.CHANGELOG_BEGIN
CHANGELOG_END
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tagsNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.
This change is