Details
-
Improvement
-
Status: Done
-
Major
-
Resolution: Done
-
None
-
None
-
None
Description
It would be extremely useful to have a 'map' higher-order function in Stellar. A 'flat map' might also be needed.
https://en.wikipedia.org/wiki/Map_(higher-order_function)
A few examples that I am thinking of. Ignore my choice of syntax. I am just trying to express the use cases here.
Fetch all of the profile measurements over the past 2 hours. There may be many. What is the mean of each of those measurements?
stats := PROFILE_GET('p1', 'e1', 2, "HOURS") stats.MAP( s -> STATS_MEAN(s))
Get profile measurements taken 1 week ago, 2 weeks ago, and 3 weeks ago, so that I can then compare them.
{ "1 week", "2 weeks", "3 weeks" }.MAP( lookback -> PROFILE_GET('p1','e1', lookback)
Attachments
Issue Links
- duplicates
-
METRON-831 Add lambda expressions and rudimentary functional programming primitives to Stellar
- Done