Uploaded image for project: 'Metron (Retired)'
  1. Metron (Retired)
  2. METRON-626

Add Higher-Order Map Function to Stellar

    XMLWordPrintableJSON

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

          Activity

            People

              Unassigned Unassigned
              nickwallen Nick Allen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: