object
Useful predicates over lists of pairs (key-value terms).
Paulo Moura
1.4
2017/5/5
static, context_switching_calls
(no dependencies on other entities)
Converts between a list of pairs and lists of keys and values.
static
keys_values(Pairs,Keys,Values)
keys_values(+list(pair),-list,-list) – one
keys_values(-list(pair),+list,+list) – one
Extracts a list of keys from a list of pairs.
static
keys(Pairs,Keys)
keys(+list(pair),-list) – one
Extracts a list of values from a list of pairs.
static
values(Pairs,Values)
values(+list(pair),-list) – one
Transposes a list of pairs by swapping each pair key and value. The relative order of the list elements is kept.
static
transpose(Pairs,TransposedPairs)
transpose(+list(pair),-list(pair)) – one
Groups pairs by key by constructing new pairs by grouping all values for a given key in a list. Keys are compared using equality. The relative order of the values for the same key is kept. The resulting list of pairs is sorted by key.
static
group_by_key(Pairs,Groups)
group_by_key(+list(pair),-list(pair)) – one
Maps a list into pairs using a closure that applies to each list element to compute its key.
static
map(Closure,List,Pairs)
map(2,*,*)
map(@callable,+list,-list(pair)) – one
(none)
(none)