# map · Rell standard library · Chromia Docs (concept)

> type map<K, V>: iterable <(K, V)> A mutable map from keys of type K to values of type V , where K is immutable, and V may be either
mutable or immutable. m

Source: https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/

TYPE

# map

```signature
type map<K, V>: iterable<(K, V)>
```

A mutable map from keys of type `K` to values of type `V`, where `K` is immutable, and `V` may be either
mutable or immutable. `map<K,V> is a subtype of` iterable<(K,V)>`. It is implemented as a hash-map, with
iteration order determined by the order in which the entries were added.

**See Also**

1. [`iterable` - Rell Standard Library](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/iterable/)

Since 0.6.0

## Methods

[clear](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/clear/)
:   Clear this map; i.e. remove all its entries. Immediately after this method returns, this map is

[contains](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/contains/)
:   Check if this map contains the given key.

[empty](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/empty/)
:   Check if this map is empty.

[get](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/get/)
:   Get the value associated with the given key in this map.

[get\_or\_default](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/get_or_default/)
:   Get the value associated with the given key in this map.

[get\_or\_null](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/get_or_null/)
:   Get the value associated with the given key in this map.

[join\_to\_text](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/join_to_text/)
:   Generate a textual representation of this iterable.

[keys](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/keys/)
:   Returns a set containing the keys of this map.

[len](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/len/)
:   Get the size (number of entries) of this map.

[map](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/map/)

[put](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/put/)
:   Associate the specified value with the specified key in this map.

[putAll](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/put-all/)
:   Update this map with the entries from another map. Where a key is found in both this and the passed

[put\_all](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/put_all/)
:   Update this map with the entries from another map. Where a key is found in both this and the passed

[put\_all\_copy](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/put_all_copy/)
:   Returns a new map with the mappings of this map combined with the mappings of the given map.

[remove](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/remove/)
:   Remove an entry from this map.

[remove\_or\_null](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/remove_or_null/)
:   Remove an entry from this map.

[size](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/size/)
:   Get the size (number of entries) of this map.

[str](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/str/)
:   Returns a textual representation of this map.

[to\_text](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/to_text/)
:   Returns a textual representation of this map.

[values](https://docs.chromia.com/pages/rell-stdlib/-rell-system-library/root/map/values/)
:   Returns a list containing the values of this map.

[View this page on docs.chromia.com](https://docs.chromia.com/pages/rell-stdlib/-rell%20-system%20-library/%5Broot%5D/map/index.html)Generated API reference, mirrored from the live docs
