Reference
std/map
std/map
Maps: size, keys, entries, update and remove.
narra
import * as Maps from "std/map"
The guide teaches it in chapter 2, Values and types.
This page is generated by scripts/std/generate.nra from narrac query --json interface std/map. Do not edit it.
Functions
entries
narra
export function entries<K, V>(map: Map<K, V>): Array<#[K, V]> uses alloc
Effects: alloc.
keys
narra
export function keys<K, V>(map: Map<K, V>): Array<K> uses alloc
Effects: alloc.
remove
narra
export function remove<K, V>(mutable map: Map<K, V>, key: K): bool uses alloc
Effects: alloc.
size
narra
export function size<K, V>(map: Map<K, V>): int
Effects: none.
update
narra
export function update<K, V>(mutable map: Map<K, V>, key: K, initial: V, change: (V) => V) uses alloc
Effects: alloc.