Page MenuHomePhabricator

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

Authored by epriestley on Sep 16 2019, 6:41 PM.
Referenced Files
Unknown Object (File)
Fri, Apr 19, 3:19 AM
Unknown Object (File)
Thu, Apr 11, 10:37 AM
Unknown Object (File)
Tue, Apr 9, 7:14 PM
Unknown Object (File)
Fri, Mar 22, 2:37 PM
Unknown Object (File)
Mar 13 2024, 9:43 PM
Unknown Object (File)
Feb 24 2024, 5:12 PM
Unknown Object (File)
Jan 1 2024, 4:55 PM
Unknown Object (File)
Dec 28 2023, 5:05 PM



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

rP Phabricator
Lint Passed
Tests Passed
Build Status
Buildable 23454
Build 32226: Run Core Tests
Build 32225: arc lint + arc unit