summaryrefslogtreecommitdiff
path: root/docs/type_system
diff options
context:
space:
mode:
Diffstat (limited to 'docs/type_system')
-rw-r--r--docs/type_system/empty.md2
-rw-r--r--docs/type_system/function.md (renamed from docs/type_system/fn.md)24
-rw-r--r--docs/type_system/index.md2
-rw-r--r--docs/type_system/overload.md2
4 files changed, 19 insertions, 11 deletions
diff --git a/docs/type_system/empty.md b/docs/type_system/empty.md
index 55bdcf1..6097711 100644
--- a/docs/type_system/empty.md
+++ b/docs/type_system/empty.md
@@ -7,7 +7,7 @@ Container type can be null
## Use with `Option` Union
```text
-make_array : Fn[yes] $ (
+make_array : ([yes]
? yes {
`some Array $ (1; 2; 3)
`nome
diff --git a/docs/type_system/fn.md b/docs/type_system/function.md
index 1bf88c5..ebd14ea 100644
--- a/docs/type_system/fn.md
+++ b/docs/type_system/function.md
@@ -1,21 +1,29 @@
-# Fn
+# Function
---
```text
-Fn_class `alias Enum[
+Function_class `alias Enum[
.unknown; .incomplete; .native
.task; process; .generator; .iterator; .closure;
.bound;
.regex
]
-Fn[Fn_class; RETURN_TYPE; Collection[ARGS]; STATE; List]
+Function[Function_class; RETURN_TYPE; Collection[TYPE.SYMBOL]; STATE; List]
+```
+
+# Alias
-Fn[Fn_class; RETURN_TYPE; ARGS...]
-Fn[RETURN_TYPE; ARGS...]
-Fn[Fn_class; ARGS...]
-Fn[ARGS...]
+```text
+Fn[Generic.T; Collection[TYPE.SYMBOL]] `alias Function[Any; Generic.T; Collection[TYPE.SYMBOL]; STATE; List]
+```
+
+# Inline Definition
+
+```text
+([x; y] x + y) // Fn[Any; Any.x; Any.y]
+([I64.x; y] x + y) // Fn[Any; I64.x; Any.y]
```
# Function Classes
@@ -75,7 +83,7 @@ Yielding wraps the value in the transient union `Next`
Return `Void` to stop iteration
```text
-fn : Fn[n] $ ( @ 1 < n {[x] `yield 2 * x; n +: 1 } )
+fn : ([n] @ 1 < n {[x] `yield 2 * x; n +: 1 } )
it : fn `sync 10
// invoking
@ it {[v] `log v } // 2 4 6 8 10 12 14 16 18 20
diff --git a/docs/type_system/index.md b/docs/type_system/index.md
index ece02b1..2d39963 100644
--- a/docs/type_system/index.md
+++ b/docs/type_system/index.md
@@ -72,7 +72,7 @@ Denotes that a field that does not resolve to anything
* #### [Var](./var.md)
-* #### [Fn](./fn.md)
+* #### [Function](./function.md)
* #### [Task](./task.md)
diff --git a/docs/type_system/overload.md b/docs/type_system/overload.md
index 11bf21d..9fd839e 100644
--- a/docs/type_system/overload.md
+++ b/docs/type_system/overload.md
@@ -11,7 +11,7 @@ Overload[Collection[FNS]]
## Example
```text
-add : Overload[Fn[.native; I64; Tuple[I64.x; I64.y]; ...]; Fn[.native; F64; Tuple[F64.x; F64.y]; ...]; ...]
+add : Overload[Fn[I64; I64.x; I64.y]; Fn[F64; F64.x; F64.y]; ...]
`log add `sync (1; 2) // Valid calls first
`log add `sync (1.1; 2.2) // Valid calls second