aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/documentation/lux/data/collection/tree.lux
blob: ed61617968a80bf3d9350a37662bbf04584222f2 (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
      ["<.>" code]]]
    [data
     ["." text (#+ \n)
      ["%" format (#+ format)]]]
    [macro
     ["." template]]]]
  [\\library
   ["." /]]
  ["." / #_
   ["#." finger]
   ["#." 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]))