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
Suppose I want to define a type that models a bijective Map like so:
Class BiMap<K, V> {
to: Map<K, V>[1];
from: Map<V, K>[1];
}
Now I want to provide to users a convenient constructor method that just yields an empty instance of BiMap:
function empty<K, V>(): BiMap<K, V>[1] {
^BiMap<K,V>(to=^Map<K,V>(), from=^Map<K,V>());
}
Such a function definition does not work for two reasons: First, PURE tries to find existing types named K and V. Second, there is no way to invoke the empty function by explicitly specifying type parameters at invocation (type parameters are always implicit via supplied function arguments).
The text was updated successfully, but these errors were encountered:
Feature Request
Description of Problem:
Suppose I want to define a type that models a bijective Map like so:
Now I want to provide to users a convenient constructor method that just yields an empty instance of
BiMap
:Such a function definition does not work for two reasons: First, PURE tries to find existing types named
K
andV
. Second, there is no way to invoke theempty
function by explicitly specifying type parameters at invocation (type parameters are always implicit via supplied function arguments).The text was updated successfully, but these errors were encountered: