summaryrefslogtreecommitdiff
path: root/docs/type_system/fn.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/type_system/fn.md')
-rw-r--r--docs/type_system/fn.md50
1 files changed, 44 insertions, 6 deletions
diff --git a/docs/type_system/fn.md b/docs/type_system/fn.md
index 6ba8c1d..edbc04a 100644
--- a/docs/type_system/fn.md
+++ b/docs/type_system/fn.md
@@ -8,18 +8,56 @@ Fn_class `alias Enum[.partial; .complete; .iterator; .closure; .bound; .regex; .
Fn[Fn_class; RETURN_TYPE; ARGS; STATE; List]
```
-# Returning
+## Transient Union Return
-## \`return
+### \`return_value
-## \`yield
+### \`return_error
+
+### \`return_some
+
+### \`return_none
+
+## Transient Union Return Chaining
+
+# Iterating
+
+## \`has_next
+
+## Transient Union Yield
+
+### \`yield_value
+
+### \`yield_error
+
+### \`yield_some
+
+### \`yield_none
+
+```text
+fn : Fn[x] $ ( @ 1 .. x { `yield_some 2 * x } )
+it : fn `sync 10
+// invoking
+@ it { `log v }[v] // Opton[Int[...]].v $ (.some : 2); Opton[Int[...]].v $ (.some : 4)
+// same as above
+@ `has_next it { `log it() }
+```
# Calling
-## \`async
+## \`call_async
-## \`sync
+```text
+task : `call_async fn
+value : `task_wait task
+```
+
+## \`call_sync
```text
-fn `sync args // `await fn `async args
+fn `call_sync args // `task_wait fn `call_async args
```
+
+## \`call_native
+
+For calling native code