From 4f4656b278c6f9dfbdd15d5d9bc86d63c5b44333 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 15 Sep 2021 20:22:07 -0400 Subject: "Sequence" => "Stream" --- .../source/documentation/lux/data/collection.lux | 4 +- .../documentation/lux/data/collection/sequence.lux | 77 ---------------------- .../documentation/lux/data/collection/stream.lux | 76 +++++++++++++++++++++ 3 files changed, 78 insertions(+), 79 deletions(-) delete mode 100644 stdlib/source/documentation/lux/data/collection/sequence.lux create mode 100644 stdlib/source/documentation/lux/data/collection/stream.lux (limited to 'stdlib/source/documentation') diff --git a/stdlib/source/documentation/lux/data/collection.lux b/stdlib/source/documentation/lux/data/collection.lux index 7d4e0a6bc..9fae3d77f 100644 --- a/stdlib/source/documentation/lux/data/collection.lux +++ b/stdlib/source/documentation/lux/data/collection.lux @@ -14,7 +14,7 @@ ["[1][0]" list] ["[1][0]" queue] ["[1][0]" row] - ["[1][0]" sequence] + ["[1][0]" stream] ["[1][0]" stack] ["[1][0]" set] ["[1][0]" tree]]) @@ -28,7 +28,7 @@ /list.documentation /queue.documentation /row.documentation - /sequence.documentation + /stream.documentation /stack.documentation /set.documentation /tree.documentation diff --git a/stdlib/source/documentation/lux/data/collection/sequence.lux b/stdlib/source/documentation/lux/data/collection/sequence.lux deleted file mode 100644 index 1bbf4db94..000000000 --- a/stdlib/source/documentation/lux/data/collection/sequence.lux +++ /dev/null @@ -1,77 +0,0 @@ -(.module: - [library - [lux {"-" list} - ["$" documentation {"+" documentation:}] - [control - ["<>" parser - ["<[0]>" code]]] - [data - ["[0]" text {"+" \n} - ["%" format {"+" format}]]] - [macro - [syntax {"+" syntax:}] - ["[0]" code] - ["[0]" template]]]] - [\\library - ["[0]" /]]) - -(documentation: (/.Sequence it) - "An infinite sequence of values.") - -(documentation: /.iterations - "A stateful way of infinitely calculating the values of a sequence." - [(iterations step init)]) - -(documentation: /.repeated - "Repeat a value forever." - [(repeated x)]) - -(documentation: /.cycle - (format "Go over the elements of a list forever." - \n "The list should not be empty.") - [(cycle [start next])]) - -(documentation: /.item - "" - [(item idx sequence)]) - -(documentation: /.only - "A new sequence only with items that satisfy the predicate." - [(only predicate sequence)]) - -(documentation: /.partition - (format "Split a sequence in two based on a predicate." - \n "The left side contains all entries for which the predicate is #1." - \n "The right side contains all entries for which the predicate is #0.") - [(partition left? xs)]) - -(documentation: /.^sequence& - (format "Allows destructuring of sequences in pattern-matching expressions." - \n "Caveat emptor: Only use it for destructuring, and not for testing values within the sequences.") - [(let [(^sequence& x y z _tail) (some_sequence_func +1 +2 +3)] - (func x y z))]) - -(.def: .public documentation - (.List $.Module) - ($.module /._ - "" - [..Sequence - ..iterations - ..repeated - ..cycle - ..item - - ..only - ..partition - ..^sequence& - ($.default /.head) - ($.default /.tail) - ($.default /.functor) - ($.default /.comonad) - ($.default /.while) - ($.default /.until) - ($.default /.first) - ($.default /.after) - ($.default /.split_when) - ($.default /.split_at)] - [])) diff --git a/stdlib/source/documentation/lux/data/collection/stream.lux b/stdlib/source/documentation/lux/data/collection/stream.lux new file mode 100644 index 000000000..9486be114 --- /dev/null +++ b/stdlib/source/documentation/lux/data/collection/stream.lux @@ -0,0 +1,76 @@ +(.module: + [library + [lux {"-" list} + ["$" documentation {"+" documentation:}] + [control + ["<>" parser + ["<[0]>" code]]] + [data + ["[0]" text {"+" \n} + ["%" format {"+" format}]]] + [macro + [syntax {"+" syntax:}] + ["[0]" code] + ["[0]" template]]]] + [\\library + ["[0]" /]]) + +(documentation: (/.Stream it) + "An infinite sequence of values.") + +(documentation: /.iterations + "A stateful way of infinitely calculating the values of a stream." + [(iterations step init)]) + +(documentation: /.repeated + "Repeat a value forever." + [(repeated x)]) + +(documentation: /.cycle + "Go over the elements of a list forever." + [(cycle [start next])]) + +(documentation: /.item + "" + [(item idx stream)]) + +(documentation: /.only + "A new stream only with items that satisfy the predicate." + [(only predicate stream)]) + +(documentation: /.partition + (format "Split a stream in two based on a predicate." + \n "The left side contains all entries for which the predicate is #1." + \n "The right side contains all entries for which the predicate is #0.") + [(partition left? xs)]) + +(documentation: /.^stream& + (format "Allows destructuring of streams in pattern-matching expressions." + \n "Caveat emptor: Only use it for destructuring, and not for testing values within the streams.") + [(let [(^stream& x y z _tail) (some_stream_func +1 +2 +3)] + (func x y z))]) + +(.def: .public documentation + (.List $.Module) + ($.module /._ + "" + [..Stream + ..iterations + ..repeated + ..cycle + ..item + + ..only + ..partition + ..^stream& + ($.default /.head) + ($.default /.tail) + ($.default /.functor) + ($.default /.comonad) + ($.default /.while) + ($.default /.until) + ($.default /.first) + ($.default /.after) + ($.default /.split_when) + ($.default /.split_at)] + [])) -- cgit v1.2.3