---
title: "empty_map"
url: https://una-lang.org/en/docs/std/prelude/empty_map/
release: v0.4.0
edition: "0.2 and later"
source: https://github.com/una-lang/una/blob/v0.4.0/docs/std/listing.json
---

# empty_map

A function of the prelude, in scope in every module. Edition 0.2 and later.

```una
pub empty_map[K: Ord, V]() -> Map[K, V]
  ensures result.len == 0
```

The map with no entries, of the type its context expects (`spec/21 §2`).

## Returns

`Map[K, V]`: the map with no entries\, of the type its context expects\; its `len` is `0`.

## See also

[`with`](https://una-lang.org/en/docs/std/builtin/with/), [`set`](https://una-lang.org/en/docs/std/builtin/set/)

## Example

`src/shop.una`

```una
module shop

--- A stock count that starts empty.
pub main() -> Unit
  uses @console: Console[print]
=
  let stock: Map[Text, Int] = empty_map()
  @console.print("{stock.len} entries")
```

`una run .` prints:

```text
0 entries
```

## Specification

- [`spec/21 §2`](https://una-lang.org/en/docs/spec/21-maps/#s2)

Generated from the standard modules of una v0.4.0 ([`docs/std/listing.json`](https://github.com/una-lang/una/blob/5fec93d88932b333feec25e589355a2cb34c37b5/docs/std/listing.json), which is not part of the specification). The specification governs: [`spec/14 §1`](https://una-lang.org/en/docs/spec/14-standard-library/#s1).
