summaryrefslogtreecommitdiff
path: root/docs/type_system/index.md
blob: 4c2fe73d29586eb2c329a16369175a3914359dff (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Types

* #### [Alias](./alias.md)

* #### [Unique](./unique.md)

---

# Representation

```text
TEMPLATE[[MODIFIERS] DEFINES...;...]
```

## Modifiers

A modifier is an internal setting (a bit mask or single value), cannot be set by a user

Each template below has its own modifiers

## Defines

User specified

# Templates

A template is an incomplete type

```text
Template[[] Field; ...]
```

If a field in a template is not filed, one of these are required:

## Any

Denotes a field in a template that has not resolved

A template by name only expands to all inner fields as `Any`

## Generic.SYMBOL

Generic for alias and unique types, type is replaced with type passed

## Collection[STORAGE; TYPE]

A list of types with shape of TYPE, only can have one collection per type

The collection is stored internally as STORAGE

If using a collection the Collection[TYPE] must be the last type on the templates type list

## Void

Denotes that a field that does not resolve to anything

## Identifier Templates

* #### [Var](./var.md)

## Value Templates

* #### [Select](./select.md)

* #### [Bit](./bit.md)

## Container Templates

* #### [Group](./group.md)

* #### [Buffer](./buffer.md)

* #### [Map](./map.md)

* #### [Queue](./queue.md)

* #### [Union](./union.md)

* #### [Native](./native.md)

* #### [Error](./error.md)

## Qualifier Templates

* #### [Const](./const.md)

* #### [Empty](./empty.md)

* #### [Ref](./ref.md)

* #### [Shared](./shared.md)

## Function Templates

* #### [Function](./function.md)

* #### [Task](./task.md)

* #### [Overload](./overload.md)

## AST Templates

* #### [Value](./value.md)

* #### [Name](./name.md)

* #### [Symbol](./symbol.md)

* #### [Op](./op.md)

* #### [List](./list.md)

* #### [Lock](./lock.md)

* #### [Namespace](./namespace.md)