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"]
}
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.