Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
A random assortment of *things* that don't really demand their own package.

## Use

To use, include in the dependencies section of ``Cargo.toml``:

grabbag = "0.1.*"

An overview of functionality is available [in the documentation](https://danielkeep.github.io/rust-grabbag/doc/grabbag/).

For example:

* ``collect!`` provides a way to initialise any container for which there is a FromIterator implementation, similar in use to ``vec!``.
* ``sequence!`` creates an iterator over a fixed sequence, such as ``sequence![ n: u64 = 2*(n as u64) + 1 ]`` for positive odd integers.
* ``group_by`` splits an iterator into a iterator of iterators, with elements grouped by a criterion.
* ``cartesian_product`` combines every item in the first iterator with every item in the second iterator, e.g. ``(1, 2, 3) x (4, 5) = ((1, 4), (1, 5), (2, 4), (2, 5), (3, 4), (3, 5))``.
* ``stride`` yields every ``n``th element, ``take_exactly`` takes ``n`` items, ``skip_exactly`` skips ``n`` items.
* ``intersperse`` it like join, inserting an element inbetween every two items.

And various other helpers [in the documentation](https://danielkeep.github.io/rust-grabbag/doc/grabbag/index.html).

## License

Licensed under either of
Expand Down