Commit 0f4bd75fc203fac50c55a73214cb5ce84cba68d8

Thomas de Grivel 2023-11-11T16:44:01

doc/list.md

diff --git a/doc/list.md b/doc/list.md
new file mode 100644
index 0000000..adf816e
--- /dev/null
+++ b/doc/list.md
@@ -0,0 +1,27 @@
+# Module List
+
+Regular lists can be :
+ - an element and a list : `[1 | [2]]`
+ - multiple elements : `[1, 2, 3]`
+ - multiple elements and a list : `[1, 2 | [3, 4]]`
+ - the empty list : `[]`
+
+Regular lists end with the empty list : `[1] == [1 | []]`.
+
+You can also contruct dotted lists like in Common Lisp where
+the next list pointer is an arbitrary form. E.g. :
+ - an element and an element : `[1 | 2]`
+ - multiple elements and an element : `[1, 2, 3 | 4]`
+ - the empty list and an element : `[[] | 1]`
+
+All these list formats are supported in pattern matching.
+
+## Functions
+
+```
+List List.map (List, Fn)
+```
+
+```
+List List.reverse (List)
+```