You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
but we have no way of describing the idea that we want 'f' with two arguments that are the same, or some other more complex match.
One way to do this would be to allow an arbitrary python function to run to check the arguments. Another option would be to develop a grammar of "types" that can be passed to the Function signature to allow it to choose how it specializes. For instance, imagine we have an object called template. Then we could have
def f(x: template.X, y: template.X):
...
where the semantics are that we match arguments from left to right and when a template variable is encountered, its value is set and future versions of that pattern insist that the value matches. this could let you say things like f(x: Dict(int, template.X), y: Dict(template.X, str)) to insist that the two types covary in a meaningful way.