2021-09-24 15:24:43 +00:00
|
|
|
<!-- Generated with Stardoc: http://skydoc.bazel.build -->
|
|
|
|
|
2021-10-27 13:13:59 +00:00
|
|
|
Skylib module containing functions that operate on collections.
|
|
|
|
|
2022-08-30 18:57:34 +00:00
|
|
|
<a id="collections.after_each"></a>
|
2021-09-24 15:24:43 +00:00
|
|
|
|
2019-02-28 22:43:57 +00:00
|
|
|
## collections.after_each
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
collections.after_each(<a href="#collections.after_each-separator">separator</a>, <a href="#collections.after_each-iterable">iterable</a>)
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
Inserts `separator` after each item in `iterable`.
|
|
|
|
|
2021-09-24 15:24:43 +00:00
|
|
|
**PARAMETERS**
|
|
|
|
|
|
|
|
|
|
|
|
| Name | Description | Default Value |
|
2021-10-27 13:13:59 +00:00
|
|
|
| :------------- | :------------- | :------------- |
|
|
|
|
| <a id="collections.after_each-separator"></a>separator | The value to insert after each item in <code>iterable</code>. | none |
|
|
|
|
| <a id="collections.after_each-iterable"></a>iterable | The list into which to intersperse the separator. | none |
|
|
|
|
|
|
|
|
**RETURNS**
|
2021-09-24 15:24:43 +00:00
|
|
|
|
2021-10-27 13:13:59 +00:00
|
|
|
A new list with `separator` after each item in `iterable`.
|
2019-02-28 22:43:57 +00:00
|
|
|
|
2021-10-27 13:13:59 +00:00
|
|
|
|
2022-08-30 18:57:34 +00:00
|
|
|
<a id="collections.before_each"></a>
|
2019-02-28 22:43:57 +00:00
|
|
|
|
|
|
|
## collections.before_each
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
collections.before_each(<a href="#collections.before_each-separator">separator</a>, <a href="#collections.before_each-iterable">iterable</a>)
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
Inserts `separator` before each item in `iterable`.
|
|
|
|
|
2021-09-24 15:24:43 +00:00
|
|
|
**PARAMETERS**
|
2019-02-28 22:43:57 +00:00
|
|
|
|
|
|
|
|
2021-09-24 15:24:43 +00:00
|
|
|
| Name | Description | Default Value |
|
2021-10-27 13:13:59 +00:00
|
|
|
| :------------- | :------------- | :------------- |
|
|
|
|
| <a id="collections.before_each-separator"></a>separator | The value to insert before each item in <code>iterable</code>. | none |
|
|
|
|
| <a id="collections.before_each-iterable"></a>iterable | The list into which to intersperse the separator. | none |
|
|
|
|
|
|
|
|
**RETURNS**
|
2021-09-24 15:24:43 +00:00
|
|
|
|
2021-10-27 13:13:59 +00:00
|
|
|
A new list with `separator` before each item in `iterable`.
|
2021-09-24 15:24:43 +00:00
|
|
|
|
2021-10-27 13:13:59 +00:00
|
|
|
|
2022-08-30 18:57:34 +00:00
|
|
|
<a id="collections.uniq"></a>
|
2021-09-24 15:24:43 +00:00
|
|
|
|
2019-02-28 22:43:57 +00:00
|
|
|
## collections.uniq
|
|
|
|
|
|
|
|
<pre>
|
|
|
|
collections.uniq(<a href="#collections.uniq-iterable">iterable</a>)
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
Returns a list of unique elements in `iterable`.
|
|
|
|
|
|
|
|
Requires all the elements to be hashable.
|
|
|
|
|
|
|
|
|
2021-09-24 15:24:43 +00:00
|
|
|
**PARAMETERS**
|
|
|
|
|
|
|
|
|
|
|
|
| Name | Description | Default Value |
|
2021-10-27 13:13:59 +00:00
|
|
|
| :------------- | :------------- | :------------- |
|
|
|
|
| <a id="collections.uniq-iterable"></a>iterable | An iterable to filter. | none |
|
|
|
|
|
|
|
|
**RETURNS**
|
|
|
|
|
|
|
|
A new list with all unique elements from `iterable`.
|
2019-02-28 22:43:57 +00:00
|
|
|
|
|
|
|
|