aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/data/collection/tree.lux
blob: 236e0533b3b0b4ff45c7c949312c331aad847610 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
(.module:
  [library
   [lux {"-" [list]}
    ["$" documentation {"+" [documentation:]}]
    [control
     ["<>" parser
      ["<[0]>" code]]]
    [data
     ["[0]" text {"+" [\n]}
      ["%" format {"+" [format]}]]]
    [macro
     ["[0]" template]]]]
  [\\library
   ["[0]" /]]
  ["[0]" / "_"
   ["[1][0]" finger]
   ["[1][0]" zipper]])

(documentation: (/.Tree it)
  "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]))