Skip to content

Map Functions

Keys

returns the keys of the map

Syntax:

Keys(m: map{string: T}) -> [string]

Examples:

Keys(map{"foo": 1, "bar": 2}) = ["bar", "foo"]

MakeMap

constructs a map from the given keys and values

Syntax:

MakeMap(keys: [string], values: [T]) -> map{string: T}

Examples:

MakeMap(["foo", "bar"], [1, 2])
map{"foo": 1, "bar": 2}

MapI2F

converts a map of ints to a map of floats

Syntax:

MapI2F(a: map{string: int?}) -> map{string: float?}

Examples:

MapI2F(map{"a": 1, b: null}) = map{"a": 1.0, b: null}

Values

returns the values of the map

Syntax:

Values(m: map{string: T}) -> [T]

Examples:

Values(map{"foo": 1, "bar": 2}) = [1, 2]