Module : lang.map

Module Overview

This module provides lang library map operations defined by the language specification 2019R3.

Objects

$anonType$2

Functions

entries

Returns a map containing [key, member] pair as the value for each key.

filter

Selects the members from a map for which a function returns true.

forEach

Applies a function to each member of a map. The function func is applied to each member of m.

get

Returns the member of map m with key k. This for use in a case where it is known that the map has a specific key, and accordingly panics if m does not have a member with key k.

hasKey

Tests whether m has a member with key k.

iterator

Returns an iterator over a map. The iterator will iterate over the members of the map not the keys. The entries function can be used to iterate over the keys and members together. The keys function can be used to iterator over just the keys.

keys

Returns a list of all the keys of map m.

length

Returns number of members of a map.

map

Applies a function each member of a map and returns a map of the result. The resulting map will have the same keys as the argument map.

reduce

Combines the members of a map using a combining function. The combining function takes the combined value so far and a member of the map, and returns a new combined value.

remove

Removes a member of a map.

removeAll

Removes all members of a map. This panics if any member cannot be removed.