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
It's fairly common to want to get a key or value from a map, but where you don't care which one. For example, if all the entries in the map have the same value for one property.
This leads to a fairly common pattern:
varsomeKeyforkey:=rangemyMap {
someKey=keybreak
}
whilst not very onerous, it breaks the flow, and it's common enough that I think it may be worth adding to the exp maps package:
// Any returns a non-deterministically chosen key and value from the map mfuncAny[M~map[K]V, Kcomparable, Vany](mM) (K, V)
The text was updated successfully, but these errors were encountered:
Proposal Details
It's fairly common to want to get a key or value from a map, but where you don't care which one. For example, if all the entries in the map have the same value for one property.
This leads to a fairly common pattern:
whilst not very onerous, it breaks the flow, and it's common enough that I think it may be worth adding to the exp maps package:
The text was updated successfully, but these errors were encountered: