filtermap[Fun, List1] -> List2OTP R16B01
Types
Calls Fun[Elem] on successive elements Elem of List1. Fun/1 must return either a Boolean or a tuple {true, Value}. The function returns the list of elements for which Fun returns a new value, where a value of true is synonymous with {true, Elem}.
That is, filtermap behaves as if it had been defined as follows:
Example:
seq[From, To] -> Seq
seq[From, To, Incr] -> Seq
Types
Returns a sequence of integers that starts with From and contains the successive results of adding Incr to the previous element, until To is reached or passed [in the latter case, To is not an element of the sequence]. Incr defaults to 1.
Failures:
If To < From - Incr and Incr > 0.
If To > From - Incr and Incr < 0.
If Incr =:= 0 and From =/= To.
The following equalities hold for all sequences:
Examples:
zipwith3[Combine, List1, List2, List3] -> List4
Types
Combines the elements of three lists of equal length into one list. For each triple X, Y, Z of list elements from the three lists, the element in the result list is Combine[X, Y, Z].
zipwith3[fun[X, Y, Z] -> {X,Y,Z} end, List1, List2, List3] is equivalent to zip3[List1, List2, List3].
Examples: