aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/data/collection/tree.lux
diff options
context:
space:
mode:
authorEduardo Julian2021-08-24 05:23:45 -0400
committerEduardo Julian2021-08-24 05:23:45 -0400
commit36303d6cb2ce3ab9e36d045b9516c997bd461862 (patch)
treeb9d2f1495143054d61d9af129f36833624db9dac /stdlib/source/documentation/lux/data/collection/tree.lux
parentec1f31b5a1492d5e0ab260397291d4449483bbd9 (diff)
Outsourced the syntax for labelled type definitions to macros.
Diffstat (limited to 'stdlib/source/documentation/lux/data/collection/tree.lux')
-rw-r--r--stdlib/source/documentation/lux/data/collection/tree.lux55
1 files changed, 55 insertions, 0 deletions
diff --git a/stdlib/source/documentation/lux/data/collection/tree.lux b/stdlib/source/documentation/lux/data/collection/tree.lux
new file mode 100644
index 000000000..310073287
--- /dev/null
+++ b/stdlib/source/documentation/lux/data/collection/tree.lux
@@ -0,0 +1,55 @@
+(.module:
+ [library
+ [lux (#- list)
+ ["$" documentation (#+ documentation:)]
+ [control
+ ["<>" parser
+ ["<.>" code]]]
+ [data
+ ["." text (#+ \n)
+ ["%" format (#+ format)]]]
+ [macro
+ ["." template]]]]
+ [\\library
+ ["." /]]
+ ["." / #_
+ ["#." finger]
+ ["#." zipper]])
+
+(documentation: /.Tree
+ "A generic tree data-structure.")
+
+(documentation: /.flat
+ "All the leaf values of the tree, in order."
+ [(flat tree)])
+
+(documentation: /.leaf
+ ""
+ [(leaf value)])
+
+(documentation: /.branch
+ ""
+ [(branch value children)])
+
+(documentation: /.tree
+ "Tree literals."
+ [(: (Tree Nat)
+ (tree 12
+ {34 {}
+ 56 {}
+ 78 {90 {}}}))])
+
+(.def: .public documentation
+ (.List $.Module)
+ ($.module /._
+ ""
+ [..Tree
+ ..flat
+ ..leaf
+ ..branch
+ ..tree
+ ($.default /.equivalence)
+ ($.default /.functor)
+ ($.default /.mix)]
+ [/finger.documentation
+ /zipper.documentation]))