aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColin Okay <cbeok@protonmail.com>2020-07-15 11:36:18 -0500
committerColin Okay <cbeok@protonmail.com>2020-07-15 11:36:18 -0500
commit26f6d7d415583d24173c089bbbbbd681fbd5012f (patch)
tree423c0ee95580337337bbeaf5563fbfe3faebfbc0
parentfe95fbad4841301f877d2d16802d097234255b53 (diff)
included mention of more combinators in the readme
-rw-r--r--README.md13
1 files changed, 11 insertions, 2 deletions
diff --git a/README.md b/README.md
index b175d34..873b4f6 100644
--- a/README.md
+++ b/README.md
@@ -283,6 +283,11 @@ Here are some simple examples of their use:
- `(skip! n gen)` produces a generator by skipping the first `n` values in `gen`
- `(skip-while! pred gen)` produces a generator by skippng elements of `gen` while `pred` is `t`
- `(merge! comp gen1 gen2 &rest gens)` emulates the behavior of `merge` but for generators
+- `(truncate! n gen)` produces at most `n` of the values produced by `gen`
+- `(inject! fn gen)` shorthand for `(map! (lambda (x) (funcall fn x) x) gen)`
+- `(intersperse! gen1 gen2 &rest gens)` returns a generator that
+ intermingles the values of its argument generators, in the order
+ they appear in the argument list.
And some experimental tools:
@@ -291,8 +296,12 @@ And some experimental tools:
- `(partition! pred gen)` returns a list of two new generators, the
first generating the memebers of `gen` that pass the predicate
`pred`, and the second generating those that don't.
-
-Both of the above are marked as EXPERIMENTAL because they may not be
+- `(disperse! n gen)` is sort of the opposite of
+ `intersperse!`. Returns a list of `n` generators, the first produces
+ every nth value from `gen`, the second produces every nth+1 values
+ from `gen`, and so on.
+
+The above are marked as EXPERIMENTAL because they may not be
in line with the the spirit of this library. I wanted the library to
produce constant-memory operations. However, when you consume the
generators that the above forms produce, then new memory will be