![]() |
|
Navigation |
Synopsis Convert a set of tuples to a map; each key is associated with a set of values.
Function
map[&A,set[&B]] toMap(rel[&A, &B] st)
Usage
import Set;
Description Convert a set of tuples to a map in which the first element of each tuple
is associated with the set of second elements of all tuples with the same first element.
Examples
rascal>import Set; ok rascal>toMap({<"a", 1>, <"b", 2>, <"a", 10>}); map[str, set[int]]: ( "a":{1,10}, "b":{2} ) Questions
Question [1].
![]() ![]()
Question [2].
![]() ![]() ![]() |