Page MenuHomePhabricator

In charts, make "min" and "max" into pure functions and formally mark pure functions as pure
ClosedPublic

Authored by epriestley on Sep 16 2019, 6:41 PM.

Details

Summary

Depends on D20814. Currently, "min()" and "max()" are still "min(f, n)". This is no longer consistent with the construction of functions a function-generators that are composed at top level.

Turn them into "min(n)" and "max(n)" (i.e., not higher-order functions).

Then, mark all the functions which are pure mathematical functions and not higher-order as "pure". These functions have no function parameters and do not reference external data. For now, this distinction has no immediate implications, but it will simplify the next change (which tracks where data came from when it originated from an external source -- these pure functions never have any source information, since they only apply pure mathematical transformations to data).

Test Plan

Loaded a burnup chart, nothing seemed obviously broken.

Diff Detail

Repository
rP Phabricator
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

epriestley created this revision.Sep 16 2019, 6:41 PM
Harbormaster returned this revision to the author for changes because remote builds failed.Sep 16 2019, 6:41 PM
Harbormaster failed remote builds in Unknown Object (Buildable)!
epriestley updated this revision to Diff 49628.Sep 16 2019, 6:47 PM
  • Rebase for library map fixes.
epriestley requested review of this revision.Sep 16 2019, 6:48 PM
This revision was not accepted when it landed; it landed in state Needs Review.Tue, Sep 17, 4:28 PM
This revision was automatically updated to reflect the committed changes.