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.
Tags
None
Referenced Files
F13455161: D20815.id49628.diff
Sun, Jul 14, 9:04 AM
F13454049: D20815.id49628.diff
Sun, Jul 14, 3:30 AM
F13453583: D20815.id.diff
Sun, Jul 14, 12:50 AM
F13453216: D20815.id.diff
Sat, Jul 13, 10:44 PM
F13453145: D20815.id49628.diff
Sat, Jul 13, 10:15 PM
F13452818: D20815.id49632.diff
Sat, Jul 13, 8:25 PM
F13452506: D20815.id49632.diff
Sat, Jul 13, 6:51 PM
F13452339: D20815.diff
Sat, Jul 13, 5:56 PM
Subscribers

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
Branch
chart2
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 23454
Build 32226: Run Core Tests
Build 32225: arc lint + arc unit