View Source listx (util v1.1.5)

Miscelaneous list functions

Link to this section Summary

Functions

Copy every element of tuple TS to tuple TT ignoring the item at Ignore position
Group elements in the List by element at position Pos.
Add every positional element of each tuple in the list. E.g. sum([{1,2}, {3,4}, {5,6}]) -> {9,12}.
Add every positional element of two tuples. E.g. sum({1,2}, {3,4}) -> {3,6}.
Convert a record/tuple to a list of {Name,Value} pairs, where Name is a field name taken from the Fields list.

Link to this section Functions

Link to this function

copy_tuple_except(Ignore, I, N, TS, TT)

View Source
Copy every element of tuple TS to tuple TT ignoring the item at Ignore position
-spec group(Pos :: integer(), List :: [tuple()]) -> [{any(), tuple()}].
Group elements in the List by element at position Pos.
Add every positional element of each tuple in the list. E.g. sum([{1,2}, {3,4}, {5,6}]) -> {9,12}.
Add every positional element of two tuples. E.g. sum({1,2}, {3,4}) -> {3,6}.
Link to this function

zip_record(Fields, State)

View Source
-spec zip_record(list(), tuple()) -> list().
Convert a record/tuple to a list of {Name,Value} pairs, where Name is a field name taken from the Fields list.