diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/data/collection/tree.lux | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/stdlib/source/library/lux/data/collection/tree.lux b/stdlib/source/library/lux/data/collection/tree.lux index 23a957fb7..7d12bad74 100644 --- a/stdlib/source/library/lux/data/collection/tree.lux +++ b/stdlib/source/library/lux/data/collection/tree.lux @@ -16,12 +16,12 @@ [syntax (#+ syntax:)] ["." code]]]]) -(type: #export (Tree a) +(type: .public (Tree a) {#.doc (doc "A generic tree data-structure.")} {#value a #children (List (Tree a))}) -(def: #export (flat tree) +(def: .public (flat tree) {#.doc (doc "All the leaf values of the tree, in order.")} (All [a] (-> (Tree a) (List a))) (|> tree @@ -30,12 +30,12 @@ list\join (#.Item (get@ #value tree)))) -(def: #export (leaf value) +(def: .public (leaf value) (All [a] (-> a (Tree a))) {#value value #children (list)}) -(def: #export (branch value children) +(def: .public (branch value children) (All [a] (-> a (List (Tree a)) (Tree a))) {#value value #children children}) @@ -54,7 +54,7 @@ (<>.else (list)) (<>.and <code>.any))) -(syntax: #export (tree {root tree^}) +(syntax: .public (tree {root tree^}) {#.doc (doc "Tree literals." (: (Tree Nat) (tree 12 @@ -65,14 +65,14 @@ (` {#value (~ value) #children (list (~+ (list\map recur children)))}))))))) -(implementation: #export (equivalence super) +(implementation: .public (equivalence super) (All [a] (-> (Equivalence a) (Equivalence (Tree a)))) (def: (= tx ty) (and (\ super = (get@ #value tx) (get@ #value ty)) (\ (list.equivalence (equivalence super)) = (get@ #children tx) (get@ #children ty))))) -(implementation: #export functor +(implementation: .public functor (Functor Tree) (def: (map f fa) @@ -80,7 +80,7 @@ #children (list\map (map f) (get@ #children fa))})) -(implementation: #export fold +(implementation: .public fold (Fold Tree) (def: (fold f init tree) |