zip v0.1.0 Zip protocol View Source
The Zip interface allows all sorts of operations on collections. If you squint you might see an applicative.
The collections need to have some sort of order for this interface to return stable results, so a good example is a list. The zip interface allows us, for example, to add elements from to lists together pairwise. What does pairwise mean? You take the first element in the first list, and the first element in the second list and add them together. Then the second elements in each list get added together and so on.
Example
iex> Zip.add([1, 2], [1, 2])
[2, 4]
Link to this section Summary
Link to this section Types
Link to this type
t()
View Source
t()
View Source
t() :: term()
t() :: term()
Link to this section Functions
Link to this function
add(a, b) View Source
Link to this function
apply(a, b, fun) View Source
Link to this function
apply(a, b, mod, fun) View Source
Link to this function
apply(a, b, mod, fun, args) View Source
Link to this function
divide(a, b) View Source
Link to this function
multiply(a, b) View Source
Link to this function