![]() |
|
Navigation |
Synopsis Make sets of elements in the range that relate to the same element in the domain.
Function
set[list[&T]] groupRangeByDomain(lrel[&U dom, &T ran] input)
Usage
import ListRelation;
Description
rascal>import ListRelation; ok rascal>skins = [<"bird", "feather">, <"dog", "fur">, <"tortoise", "shell">, <"human", "skin">, <"fish", "scale">, <"lizard", "scale">, <"crab", "shell">, <"cat", "fur">]; lrel[str,str]: [ <"bird","feather">, <"dog","fur">, <"tortoise","shell">, <"human","skin">, <"fish","scale">, <"lizard","scale">, <"crab","shell">, <"cat","fur"> ] rascal>groupRangeByDomain(skins); set[list[str]]: { ["scale"], ["shell"], ["skin"], ["feather"], ["fur"] } ![]() |