summaryrefslogtreecommitdiff
path: root/docs/type_system/empty.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/type_system/empty.md')
-rw-r--r--docs/type_system/empty.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/type_system/empty.md b/docs/type_system/empty.md
index ab0226d..55bdcf1 100644
--- a/docs/type_system/empty.md
+++ b/docs/type_system/empty.md
@@ -5,3 +5,19 @@
Container type can be null
## Use with `Option` Union
+
+```text
+make_array : Fn[yes] $ (
+ ? yes {
+ `some Array $ (1; 2; 3)
+ `nome
+ }
+)
+v : make_array(...) // Empty[Array[I64]] $ .none OR Empty[Array[I64]] $ (.some : (1; 2; 3))
+# v {
+ .some {[x] `log x } // Array[I64] $ (1; 2; 3)
+ .none { ... }
+}
+// same as above
+? v {[x] `log x } // Array[I64] $ (1; 2; 3)
+```