diff options
Diffstat (limited to 'stdlib/source/documentation/lux/data')
8 files changed, 440 insertions, 11 deletions
diff --git a/stdlib/source/documentation/lux/data/collection.lux b/stdlib/source/documentation/lux/data/collection.lux index e96f59465..04470c5ca 100644 --- a/stdlib/source/documentation/lux/data/collection.lux +++ b/stdlib/source/documentation/lux/data/collection.lux @@ -15,14 +15,9 @@ ["#." queue] ["#." row] ["#." sequence] - ... ["#." stack] - ... ["#." set - ... ["#/." multi] - ... ["#/." ordered]] - ... ["#." tree - ... ["#/." finger] - ... ["#/." zipper]] - ]) + ["#." stack] + ["#." set] + ["#." tree]]) (.def: .public documentation (.List $.Module) @@ -34,7 +29,7 @@ /queue.documentation /row.documentation /sequence.documentation - ... /stack.documentation - ... /set.documentation - ... /tree.documentation + /stack.documentation + /set.documentation + /tree.documentation ))) diff --git a/stdlib/source/documentation/lux/data/collection/set.lux b/stdlib/source/documentation/lux/data/collection/set.lux new file mode 100644 index 000000000..2778305ec --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/set.lux @@ -0,0 +1,63 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]] + ["." / #_ + ["#." multi] + ["#." ordered]]) + +(documentation: /.has + "" + [(has elem set)]) + +(documentation: /.difference + "" + [(difference sub base)]) + +(documentation: /.intersection + "" + [(intersection filter base)]) + +(documentation: /.sub? + "" + [(sub? super sub)]) + +(documentation: /.super? + "" + [(super? sub super)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..has + ..difference + ..intersection + ..sub? + ..super? + ($.default /.Set) + ($.default /.member_hash) + ($.default /.empty) + ($.default /.size) + ($.default /.lacks) + ($.default /.member?) + ($.default /.list) + ($.default /.union) + ($.default /.equivalence) + ($.default /.hash) + ($.default /.monoid) + ($.default /.empty?) + ($.default /.of_list) + ($.default /.predicate)] + [/multi.documentation + /ordered.documentation])) diff --git a/stdlib/source/documentation/lux/data/collection/set/multi.lux b/stdlib/source/documentation/lux/data/collection/set/multi.lux new file mode 100644 index 000000000..6e38886dc --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/set/multi.lux @@ -0,0 +1,81 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Set + "A set that keeps track of repetition in its entries.") + +(documentation: /.has + "" + [(has multiplicity elem set)]) + +(documentation: /.lacks + "" + [(lacks multiplicity elem set)]) + +(documentation: /.multiplicity + "" + [(multiplicity set elem)]) + +(template [<name>] + [(documentation: <name> + "" + [(<name> parameter subject)])] + + [/.union] + [/.sum] + [/.intersection] + [/.difference] + ) + +(documentation: /.sub? + "Is 'subject' a sub-set of 'reference'?" + [(sub? reference subject)]) + +(documentation: /.support + "A set of the unique (non repeated) members." + [(support set)]) + +(documentation: /.member? + "" + [(member? set elem)]) + +(documentation: /.super? + "Is 'subject' a super-set of 'reference'?") + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Set + ..has + ..lacks + ..multiplicity + ..union + ..sum + ..intersection + ..difference + ..sub? + ..support + ..member? + ..super? + ($.default /.empty) + ($.default /.size) + ($.default /.list) + ($.default /.equivalence) + ($.default /.hash) + ($.default /.empty?) + ($.default /.of_list) + ($.default /.of_set)] + [])) diff --git a/stdlib/source/documentation/lux/data/collection/set/ordered.lux b/stdlib/source/documentation/lux/data/collection/set/ordered.lux new file mode 100644 index 000000000..0ace59c12 --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/set/ordered.lux @@ -0,0 +1,64 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Set + "A set with ordered entries.") + +(documentation: /.member? + "" + [(member? set elem)]) + +(documentation: /.has + "" + [(has elem set)]) + +(documentation: /.lacks + "" + [(lacks elem set)]) + +(documentation: /.difference + "" + [(difference param subject)]) + +(documentation: /.sub? + "Is 'sub' a sub-set of 'super'?" + [(sub? super sub)]) + +(documentation: /.super? + "Is 'super' a super-set of 'sub'?" + [(super? sub super)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Set + ..member? + ..has + ..lacks + ..difference + ..sub? + ..super? + ($.default /.empty) + ($.default /.min) + ($.default /.max) + ($.default /.size) + ($.default /.empty?) + ($.default /.list) + ($.default /.of_list) + ($.default /.union) + ($.default /.intersection) + ($.default /.equivalence)] + [])) diff --git a/stdlib/source/documentation/lux/data/collection/stack.lux b/stdlib/source/documentation/lux/data/collection/stack.lux new file mode 100644 index 000000000..c020db741 --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/stack.lux @@ -0,0 +1,44 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Stack + "A first-in, last-out sequential data-structure.") + +(documentation: /.value + "Yields the top value in the stack, if any." + [(value stack)]) + +(documentation: /.next + "" + [(next stack)]) + +(documentation: /.top + "" + [(top value stack)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Stack + ..value + ..next + ..top + ($.default /.empty) + ($.default /.size) + ($.default /.empty?) + ($.default /.equivalence) + ($.default /.functor)] + [])) 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])) diff --git a/stdlib/source/documentation/lux/data/collection/tree/finger.lux b/stdlib/source/documentation/lux/data/collection/tree/finger.lux new file mode 100644 index 000000000..683d98f51 --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/tree/finger.lux @@ -0,0 +1,60 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Tree + "A finger tree.") + +(documentation: /.Builder + "A builder for finter tree structures.") + +(documentation: /.builder + "A new builder using the given monoid." + [(builder monoid)]) + +(documentation: /.value + "" + [(value tree)]) + +(documentation: /.tags + "" + [(tags tree)]) + +(documentation: /.values + "" + [(values tree)]) + +(documentation: /.one + "Finds one value that meets the predicate." + [(one predicate tree)]) + +(documentation: /.exists? + "Verifies that a value exists which meets the predicate." + [(exists? predicate tree)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Tree + ..Builder + ..builder + ..value + ..tags + ..values + ..one + ..exists? + ($.default /.tag) + ($.default /.root)] + [])) diff --git a/stdlib/source/documentation/lux/data/collection/tree/zipper.lux b/stdlib/source/documentation/lux/data/collection/tree/zipper.lux new file mode 100644 index 000000000..d67fb37bf --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/tree/zipper.lux @@ -0,0 +1,67 @@ +(.module: + [library + [lux (#- list) + ["$" documentation (#+ documentation:)] + [control + ["<>" parser + ["<.>" code]]] + [data + ["." text (#+ \n) + ["%" format (#+ format)]]] + [macro + ["." template]]]] + [\\library + ["." /]]) + +(documentation: /.Zipper + "Tree zippers, for easy navigation and editing of trees.") + +(documentation: /.set + "" + [(set value zipper)]) + +(documentation: /.update + "" + [(update transform zipper)]) + +(documentation: /.interpose + "" + [(interpose value zipper)]) + +(documentation: /.adopt + "" + [(adopt value zipper)]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Zipper + ..set + ..update + ..interpose + ..adopt + ($.default /.equivalence) + ($.default /.zipper) + ($.default /.tree) + ($.default /.value) + ($.default /.leaf?) + ($.default /.branch?) + ($.default /.start?) + ($.default /.down) + ($.default /.up) + ($.default /.right) + ($.default /.rightmost) + ($.default /.left) + ($.default /.leftmost) + ($.default /.next) + ($.default /.previous) + ($.default /.end) + ($.default /.start) + ($.default /.end?) + ($.default /.remove) + ($.default /.insert_left) + ($.default /.insert_right) + ($.default /.functor) + ($.default /.comonad)] + [])) |