Page MenuHomePhabricator

Provide a 'map' type (object -> object)
Closed, ResolvedPublic

Description

  • Add to schemata definitions
  • Add to orchestrator
  • Add to evaluator
  • Add example call to MW

Event Timeline

Seems like the most straightforward implementation would be a list of pairs (do we have a ZID for that yet?).
So this means that a Map is a generic type parametrized by a generic type parametrized by a generic type 😎

Let's assume the cast of characters is like this:
Z1010 -> Generic List
Z834 -> Generic Pair
Z836 -> Generic Map

So a Map ( String -> Bool ) would minimally be specified as

{
    Z1K1: Z7,
    Z7K1: Z836,
    Z836K1: Z6,
    Z836K2: Z40
}

and an instantiation representing the map

{ 'true': True } (https://www.youtube.com/watch?v=V4kWQSpCbvo)

would look like

{
  Z1K1: {
    Z1K1: Z7,
    Z7K1: Z836,
    Z836K1: Z6,
    Z836K2: Z40
  },
  K1: {
    Z1K1: {
      Z1K1: Z7,
      Z7K1: Z1010
      Z1010K1: {
        Z1K1: Z7,
        Z7K1: Z834,
        Z834K1: Z6,
        Z834K2: Z40
      },
      K1: {
        Z1K1: {
          Z1K1: Z7,
          Z7K1: Z834,
          Z834K1: Z6,
          Z834K2: Z40
        },
        K1: "true",
        K2: {
          Z1K1: Z40,
          Z40K1: Z41
        }
      }
      K2: <tail of the list, so same Z1K1, no K1 or K2>
    }
  }
}

Does that work?

Change 740662 had a related patch set uploaded (by Cory Massaro; author: Cory Massaro):

[mediawiki/services/function-evaluator@master] Support serialization/deserialization of generic maps in executors.

https://gerrit.wikimedia.org/r/740662

Change 740664 had a related patch set uploaded (by Cory Massaro; author: Cory Massaro):

[mediawiki/extensions/WikiLambda@master] Add example function call using the generic Map function.

https://gerrit.wikimedia.org/r/740664

Change 740665 had a related patch set uploaded (by Cory Massaro; author: Cory Massaro):

[mediawiki/services/function-orchestrator@master] Add generic map type function.

https://gerrit.wikimedia.org/r/740665

Change 740665 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] Add generic map type function.

https://gerrit.wikimedia.org/r/740665

Jdforrester-WMF changed the task status from Open to In Progress.Nov 23 2021, 7:20 PM
Jdforrester-WMF reassigned this task from DVrandecic to cmassaro.
Jdforrester-WMF updated the task description. (Show Details)
Jdforrester-WMF added a subscriber: DVrandecic.

Change 740664 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Add example function call using the generic Map function.

https://gerrit.wikimedia.org/r/740664

Change 742953 had a related patch set uploaded (by Jforrester; author: Cory Massaro):

[mediawiki/services/function-schemata@master] definitions: Add Z883/Typed Map and its implementation Z983

https://gerrit.wikimedia.org/r/742953

Change 742953 merged by jenkins-bot:

[mediawiki/services/function-schemata@master] definitions: Add Z883/Typed Map and its implementation Z983

https://gerrit.wikimedia.org/r/742953

Change 742971 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (b129836)

https://gerrit.wikimedia.org/r/742971

Change 742972 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/services/function-orchestrator@master] Update function-schemata sub-module to HEAD (b129836)

https://gerrit.wikimedia.org/r/742972

Change 742974 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/services/function-evaluator@master] Update function-schemata sub-module to HEAD (b129836)

https://gerrit.wikimedia.org/r/742974

Change 742972 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] Update function-schemata sub-module to HEAD (b129836)

https://gerrit.wikimedia.org/r/742972

Change 742974 merged by jenkins-bot:

[mediawiki/services/function-evaluator@master] Update function-schemata sub-module to HEAD (b129836)

https://gerrit.wikimedia.org/r/742974

Change 742971 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] Update function-schemata sub-module to HEAD (b129836)

https://gerrit.wikimedia.org/r/742971

Change 740662 merged by jenkins-bot:

[mediawiki/services/function-evaluator@master] Support serialization/deserialization of generic maps in executors.

https://gerrit.wikimedia.org/r/740662