noether v0.1.1 Noether.List
Link to this section Summary
Functions
Given a predicate, a function of arity 1, and a value, the function is applied repeatedly until the predicate applied to the value returns either nil
, false
, or {:error, _}
. The list of results is returned.
Given two lists and a function of arity 2, the lists are first zipped and then each tuple is applied (curried) to the function.
Link to this section Types
Link to this type
fun1()
Link to this type
fun2()
Link to this section Functions
Link to this function
until(p, f, a)
Given a predicate, a function of arity 1, and a value, the function is applied repeatedly until the predicate applied to the value returns either nil
, false
, or {:error, _}
. The list of results is returned.
Examples
iex> until(fn a -> a < 10 end, &(&1 + 1), 0)
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
Link to this function
zip_with(a, b, f)
Given two lists and a function of arity 2, the lists are first zipped and then each tuple is applied (curried) to the function.
Examples
iex> zip_with([1, 2, 3], [4, 5, 6], &Kernel.+/2)
[5, 7, 9]