ExDash v0.2.0 Exdash.Collection

Summary

Functions

Check if fun returns thruthy for all elements of collection. Iteration is stopped once the invocation of fun returns a falsy value

Filters the enumerable, i.e. returns only those elements for which fun returns a truthy value

Returns the first value of which invoking fun equals true. Otherwise return default

Same as Exdash.Collection.find but searches through the collection from right to left

Returns a list where each item is the result of invoking fun on each element in the collection

Same as Exdash.Collection.every but executed in parallel

Same as Exdash.Collection.filter but executed in parallel

Same as Exdash.Collection.find but executed in parallel

Same as Exdash.Collection.find_last but executed in parallel

Same as Exdash.Collection.map but executed in parallel

Functions

every(collection, fun)

Check if fun returns thruthy for all elements of collection. Iteration is stopped once the invocation of fun returns a falsy value.

Examples

iex> Exdash.Collection.every([1, 2, 3], &(&1 > 0))
true

iex> Exdash.Collection.every([-1, 2, 3], &(&1 > 0))
false
filter(collection, fun)

Filters the enumerable, i.e. returns only those elements for which fun returns a truthy value.

Examples

iex> Enum.filter([1, 2, 3], &(&1 > 1))
[2, 3]
find(collection, fun)
find(collection, default, fun)

Returns the first value of which invoking fun equals true. Otherwise return default.

Examples

iex> Exdash.Collection.find([1, 2, 3], &(&1 > 2))
3
find_last(collection, default, fun)

Same as Exdash.Collection.find but searches through the collection from right to left.

map(collection, fun)

Returns a list where each item is the result of invoking fun on each element in the collection.

Examples

iex> Exdash.Collection.map([1, 2, 3], &(&1 + 1))
[2, 3, 4]
pevery(collection, fun)

Same as Exdash.Collection.every but executed in parallel.

pfilter(collection, fun)

Same as Exdash.Collection.filter but executed in parallel.

pfind(collection, default, fun)

Same as Exdash.Collection.find but executed in parallel.

pfind_last(collection, default, fun)

Same as Exdash.Collection.find_last but executed in parallel.

pmap(collection, fun)

Same as Exdash.Collection.map but executed in parallel.