summaryrefslogtreecommitdiff
path: root/docs/type_system/option.md
blob: 1cc70a7c21c182f5315d1690076400c4c3305c1c (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Option

---

A 128bit status value pair, cannot be stored.

An option represents not having a value is a possibility

```text
Option[TYPE]
```

# Default

```text
x : // something that returns an option
// x is the value from the option
```

If option is none an error is thrown

# Use with `Empty` qualifier

If the option is assigned to a type with `Empty` an error will not be through if the option is none

# Matching

```text
# ... {
    .some { arg; ... }[arg]
    .nome { ... }
}
```

## .some

## .none

# Return

## \`some

## \`none