This module implements common operations on Key-Value lists, also
known as Pairs. Pairs have great practical value, especially due
to
keysort/2 and the
library assoc.pl
.
This library is based on disussion in the SWI-Prolog mailinglist, including specifications from Quintus and a library proposal by Richard O'Keefe.
Deterministic if any argument is instantiated to a finite list and the others are either free or finite lists.
?- group_pairs_by_key([a-2, a-1, b-4], X). X = [a-[2,1], b-[4]]