object
pairs¶
Useful predicates over lists of pairs (key-value terms).
Author: Paulo Moura
Version: 1:5:0
Date: 2019-03-08
Compilation flags:
static, context_switching_callsDependencies:
(none)
Remarks:
Usage: This object can be loaded independently of other entities in the
typeslibrary by using the goallogtalk_load(types(pairs)).
Inherited public predicates:
(none)
Public predicates¶
keys_values/3¶
Converts between a list of pairs and lists of keys and values.
Compilation flags:
staticTemplate:
keys_values(Pairs,Keys,Values)Mode and number of proofs:
keys_values(+list(pair),-list,-list) - onekeys_values(-list(pair),+list,+list) - onekeys/2¶
Extracts a list of keys from a list of pairs.
Compilation flags:
staticTemplate:
keys(Pairs,Keys)Mode and number of proofs:
keys(+list(pair),-list) - onevalues/2¶
Extracts a list of values from a list of pairs.
Compilation flags:
staticTemplate:
values(Pairs,Values)Mode and number of proofs:
values(+list(pair),-list) - onetranspose/2¶
Transposes a list of pairs by swapping each pair key and value. The relative order of the list elements is kept.
Compilation flags:
staticTemplate:
transpose(Pairs,TransposedPairs)Mode and number of proofs:
transpose(+list(pair),-list(pair)) - onegroup_by_key/2¶
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.
Compilation flags:
staticTemplate:
group_by_key(Pairs,Groups)Mode and number of proofs:
group_by_key(+list(pair),-list(pair)) - oneProtected predicates¶
(none)
Private predicates¶
(none)