summaryrefslogtreecommitdiff
path: root/docs/type_system/empty.md
blob: 08b0977368f1cececb5c78a0584b6ae606dbb0f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Empty

---

Container type can be null

```text
`empty
```

## Use with `Option` Union

```text
make_array : ([yes]
    ? yes {
        `some Array $ (1; 2; 3)
        `nome
    }
)
v : make_array(...) // `empty Array[I64] $ .none OR `empty Array[I64] $ (.some : (1; 2; 3))
# v {
    .some {[x] `log x } // Array[I64] $ (1; 2; 3)
    .none { ... }
}
// same as above
? v {[x] `log x } // Array[I64] $ (1; 2; 3)
```