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

---

Container type can be null

## 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)
```