2
0
Fork 0
mirror of https://github.com/bazelbuild/bazel-skylib synced 2024-11-27 05:43:25 +00:00
bazel-skylib/docs/collections_doc.md
nickgooding 31ab4c8bd2
feat: bzlmod setup (#385)
Creates MODULE.bazel and WORKSPACE.bzlmod files to enable bazel-skylib
to work with the `--experimental_enable_bzlmod` flag.

rules_go has been updated as the previously used version is not
available in the BCR.

stardoc has been updated due to a strange issue with Bzlmod enabled that
caused the `diff_test` and `unittest` docs to be generated without any
contents that was magically fixed upon updating.

bazelbuild/bazel-central-registry#124

Co-authored-by: Alexandre Rostovtsev <arostovtsev@google.com>
2022-08-30 14:57:34 -04:00

2 KiB
Executable file

Skylib module containing functions that operate on collections.

collections.after_each

collections.after_each(separator, iterable)

Inserts separator after each item in iterable.

PARAMETERS

Name Description Default Value
separator The value to insert after each item in iterable. none
iterable The list into which to intersperse the separator. none

RETURNS

A new list with separator after each item in iterable.

collections.before_each

collections.before_each(separator, iterable)

Inserts separator before each item in iterable.

PARAMETERS

Name Description Default Value
separator The value to insert before each item in iterable. none
iterable The list into which to intersperse the separator. none

RETURNS

A new list with separator before each item in iterable.

collections.uniq

collections.uniq(iterable)

Returns a list of unique elements in iterable.

Requires all the elements to be hashable.

PARAMETERS

Name Description Default Value
iterable An iterable to filter. none

RETURNS

A new list with all unique elements from iterable.