Page MenuHomePhabricator

Make the UX able to have users implement the Map function (not type)
Closed, ResolvedPublic

Description

the UX does not display the first argument of the Cons correctly
the UX does not allow us to use a function that is an argument as a function call

Event Timeline

Is Map enabled and available in the system right now?

Is Map enabled and available in the system right now?

No, though I've proposed that (T289376). This is about Denny's attempt to implement it on NotWikiLambda in the parent patch, and the issues he ran into (see https://notwikilambda.toolforge.org/wiki/ZObject:Z10044 and https://notwikilambda.toolforge.org/wiki/ZObject:Z10045 for what the current renders are).

Here is the implementation of Map that I am using:

{
    "Z1K1": "Z2",
    "Z2K1": {
        "Z1K1": "Z6",
        "Z6K1": "Z10124"
    },
    "Z2K2": {
        "Z1K1": "Z14",
        "Z14K1": "Z10123",
        "Z14K2": {
            "Z1K1": "Z7",
            "Z7K1": "Z802",
            "Z802K1": {
                "Z1K1": "Z7",
                "Z7K1": "Z813",
                "Z813K1": {
                    "Z1K1": "Z18",
                    "Z18K1": {
                        "Z1K1": "Z6",
                        "Z6K1": "Z10123K2"
                    }
                }
            },
            "Z802K2": {
                "Z1K1": "Z18",
                "Z18K1": {
                    "Z1K1": "Z6",
                    "Z6K1": "Z10123K2"
                }
            },
            "Z802K3": {
                "Z1K1": "Z7",
                "Z7K1": "Z810",
                "Z810K1": {
                    "Z1K1": "Z7",
                    "Z7K1": {
                        "Z1K1": "Z18",
                        "Z18K1": {
                            "Z1K1": "Z6",
                            "Z6K1": "Z10123K1"
                        }
                    },
                    "K1": {
                        "Z1K1": "Z7",
                        "Z7K1": "Z811",
                        "Z811K1": {
                            "Z1K1": "Z18",
                            "Z18K1": {
                                "Z1K1": "Z6",
                                "Z6K1": "Z10123K2"
                            }
                        }
                    }
                },
                "Z810K2": {
                    "Z1K1": "Z7",
                    "Z7K1": "Z10123",
                    "Z10123K1": {
                        "Z1K1": "Z18",
                        "Z18K1": {
                            "Z1K1": "Z6",
                            "Z6K1": "Z10123K1"
                        }
                    },
                    "Z10123K2": {
                        "Z1K1": "Z7",
                        "Z7K1": "Z812",
                        "Z812K1": {
                            "Z1K1": "Z18",
                            "Z18K1": {
                                "Z1K1": "Z6",
                                "Z6K1": "Z10123K2"
                            }
                        }
                    }
                }
            }
        }
    },
    "Z2K3": {
        "Z1K1": "Z12",
        "Z12K1": [
            {
                "Z1K1": "Z11",
                "Z11K1": "Z1002",
                "Z11K2": "Map composition"
            }
        ]
    },
    "Z2K4": {
        "Z1K1": "Z32",
        "Z32K1": [
            {
                "Z1K1": "Z31",
                "Z31K1": "Z1002",
                "Z31K2": []
            }
        ]
    }
}

This seems to work on the backend with a single element list. When I run it with negate on a list with one boolean, it totally does what I expect it to do.

(It does not work for a longer list, but I think that is a problem that is a different problem)

The originally filed issues in the description still persist:

  • the UX does not display the first argument of the Z810/Prepend element to list correctly

See here:

prepend-incorrect.png (1×1 px, 183 KB)

The second problem also still persists:

  • the UX does not allow us to use a function that is an argument as a function call

This can be seen here: I chose to add a function call, and it asks me to select the function. My function is the first argument, but I cannot select the argument for that.

cannot-choose-argument-for-function-call.png (1×1 px, 207 KB)

Hi Adesoji, you moved it to Needs discussion, and wanted to ask what the questions are you have? Should we have a meeting, or how to proceed?

Not really a discussion but it needs some other tickets to be done first before we can work on it. We need to have Typed array sorted on the frontend and also the MAP, which i think @cmassaro is working on.

DVrandecic raised the priority of this task from Low to High.Dec 8 2021, 11:34 PM

Change 755337 had a related patch set uploaded (by Simone Cuomo; author: Simone Cuomo):

[mediawiki/extensions/WikiLambda@master] Implement Map in the FE

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

Jdforrester-WMF renamed this task from Make the UX able to have users implement the Map function to Make the UX able to have users implement the Map function (not type).Jan 25 2022, 5:12 PM

@DVrandecic Can you check that waht I have done is what you expected.

You are now able to use a typedMap in the UI.

NOTE: The use of a typed MAP as a FUNCTION argument will not work as the Function editor / creation for that complex scenario has still not being completed.

JKieserman moved this task from Incoming to Code Review on the Abstract Wikipedia team (Phase θ – Throttling) board.

@JKieserman Hey there, what's in Code Review on this? Or just a mis-click?