From 43b760058ae67f060fe89e6538d872fe982b3cb6 Mon Sep 17 00:00:00 2001 From: nodist Date: Sat, 9 May 2026 17:08:10 -0400 Subject: container types --- docs/type_system/array.md | 9 +++++++++ docs/type_system/buffer.md | 17 +++++++++++++++++ docs/type_system/index.md | 20 +++++++++++--------- docs/type_system/lock.md | 9 +++++++++ docs/type_system/map.md | 7 +++++++ docs/type_system/option.md | 4 ++-- docs/type_system/qualifiers.md | 6 ++++-- docs/type_system/set.md | 7 +++++++ docs/type_system/table.md | 9 +++++++++ docs/type_system/tuple.md | 9 +++++++++ docs/type_system/vector.md | 9 +++++++++ mkdocs.yml | 8 ++++++++ 12 files changed, 101 insertions(+), 13 deletions(-) create mode 100644 docs/type_system/array.md create mode 100644 docs/type_system/buffer.md create mode 100644 docs/type_system/lock.md create mode 100644 docs/type_system/map.md create mode 100644 docs/type_system/set.md create mode 100644 docs/type_system/table.md create mode 100644 docs/type_system/tuple.md create mode 100644 docs/type_system/vector.md diff --git a/docs/type_system/array.md b/docs/type_system/array.md new file mode 100644 index 0000000..2433cd5 --- /dev/null +++ b/docs/type_system/array.md @@ -0,0 +1,9 @@ +# Array + +--- + +A sequence of TYPES with known size + +```text +Array[TYPE; Value[Int[...]; ...]] +``` diff --git a/docs/type_system/buffer.md b/docs/type_system/buffer.md new file mode 100644 index 0000000..5333cee --- /dev/null +++ b/docs/type_system/buffer.md @@ -0,0 +1,17 @@ +# Buffer + +--- + +An sequence of bytes with unknown size and an encoding + +```text +Buffer_encoding : Enum[.byte; .utf8; .utf16; .utf32] + +Buffer[Buffer_encoding] +``` + +## Alias + +``` +String `alias Buffer[.utf8] +``` diff --git a/docs/type_system/index.md b/docs/type_system/index.md index acec8de..9c8d477 100644 --- a/docs/type_system/index.md +++ b/docs/type_system/index.md @@ -34,26 +34,28 @@ Denotes that a field that does not resolve to anything * #### [Result](./result.md) -## Nullable Templates +* #### [Lock](./lock.md) -* #### Tuple +## Container Templates + +* #### [Tuple](./tuple.md) + +* #### [Table](./table.md) -* #### Table +* #### [Buffer](./buffer.md) -* #### Array +* #### [Array](./array.md) -* #### Vector +* #### [Vector](./vector.md) -* #### Map +* #### [Map](./map.md) -* #### Set +* #### [Set](./set.md) * #### Queue * #### Error -## Container Templates - * #### Union * #### Shared diff --git a/docs/type_system/lock.md b/docs/type_system/lock.md new file mode 100644 index 0000000..0b82088 --- /dev/null +++ b/docs/type_system/lock.md @@ -0,0 +1,9 @@ +# Lock + +--- + +Prevents NAME from being modified while TYPE is accessed as a Ref + +```text +Lock[Name; Ref[TYPE]] +``` diff --git a/docs/type_system/map.md b/docs/type_system/map.md new file mode 100644 index 0000000..4133bd5 --- /dev/null +++ b/docs/type_system/map.md @@ -0,0 +1,7 @@ +# Map + +--- + +```text +Map[KEY_TYPE; VALUE_TYPE] +``` diff --git a/docs/type_system/option.md b/docs/type_system/option.md index 1cc70a7..55e6b76 100644 --- a/docs/type_system/option.md +++ b/docs/type_system/option.md @@ -19,9 +19,9 @@ x : // something that returns an option If option is none an error is thrown -# Use with `Empty` qualifier +## 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 +If the option is assigned to a type with `Empty`, no error is thrown. The empty value will be `nil` if the option is `none` # Matching diff --git a/docs/type_system/qualifiers.md b/docs/type_system/qualifiers.md index 2244101..8a92086 100644 --- a/docs/type_system/qualifiers.md +++ b/docs/type_system/qualifiers.md @@ -2,8 +2,12 @@ --- +Only one can be applied to a type at a time + # Empty +Specifies that a container template can be NULL + ```text # EMPTY { .some { args; ... }[args] @@ -17,6 +21,4 @@ # Const -# Lock - # Ref diff --git a/docs/type_system/set.md b/docs/type_system/set.md new file mode 100644 index 0000000..51d3f2d --- /dev/null +++ b/docs/type_system/set.md @@ -0,0 +1,7 @@ +# Set + +--- + +```text +Set[TYPE] +``` diff --git a/docs/type_system/table.md b/docs/type_system/table.md new file mode 100644 index 0000000..b94e07a --- /dev/null +++ b/docs/type_system/table.md @@ -0,0 +1,9 @@ +# Table + +--- + +A sequence of different types accessed by symbol + +```text +Table[TYPE.SYMBOL; ...] +``` diff --git a/docs/type_system/tuple.md b/docs/type_system/tuple.md new file mode 100644 index 0000000..81f482f --- /dev/null +++ b/docs/type_system/tuple.md @@ -0,0 +1,9 @@ +# Tuple + +--- + +A sequence of different types accessed by index + +```text +Tuple[TYPE; ...] +``` diff --git a/docs/type_system/vector.md b/docs/type_system/vector.md new file mode 100644 index 0000000..e1f2e23 --- /dev/null +++ b/docs/type_system/vector.md @@ -0,0 +1,9 @@ +# Vector + +--- + +A sequence of TYPES with unknown size + +```text +Vector[TYPE] +``` diff --git a/mkdocs.yml b/mkdocs.yml index 8b237ec..1b97cf8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -20,3 +20,11 @@ nav: - Float: 'type_system/float.md' - Option: 'type_system/option.md' - Result: 'type_system/result.md' + - Lock: 'type_system/lock.md' + - Buffer: 'type_system/buffer.md' + - Tuple: 'type_system/tuple.md' + - Table: 'type_system/table.md' + - Array: 'type_system/array.md' + - Vector: 'type_system/vector.md' + - Map: 'type_system/map.md' + - Set: 'type_system/set.md' -- cgit v1.2.3