blob: 3bc81deff26833ca7dc7a1eb7fa307bd7f07f9b2 (
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
44
|
Explanation: Every optional element ends with a type annotation for the element
that might be present, like this:
┌────────────────────────┐
│ [1] : Optional Integer │ An optional element that's present
└────────────────────────┘
⇧
The type of the ❰Optional❱ element, which is an ❰Integer❱
┌────────────────────────┐
│ [] : Optional Integer │ An optional element that's absent
└────────────────────────┘
⇧
You still specify the type even when the element is absent
The element type must be a type and not something else. For example, the
following element types are $_NOT valid:
┌──────────────────┐
│ ... : Optional 1 │
└──────────────────┘
⇧
This is an ❰Integer❱ and not a ❰Type❱
┌─────────────────────┐
│ ... : Optional Type │
└─────────────────────┘
⇧
This is a ❰Kind❱ and not a ❰Type❱
Even if the element is absent you still must specify a valid type
You declared that the ❰Optional❱ element should have type:
↳ $txt0
... which is not a ❰Type❱
|