Navigation
Synopsis Domain of a relation: a set consisting of the first element of each tuple.
Function
  1. set[&T0] domain (rel[&T0,&T1] R)
  2. set[&T0] domain (rel[&T0,&T1,&T2] R)
  3. set[&T0] domain (rel[&T0,&T1,&T2,&T3] R)
  4. set[&T0] domain (rel[&T0,&T1,&T2,&T3,&T4] R)
Usage import Relation;
Examples
rascal>import Relation;
ok
rascal>domain({<1,10>, <2,20>});
set[int]: {1,2}
rascal>domain({<"mon", 1>, <"tue", 2>});
set[str]: {"tue","mon"}

Questions
Question [1].
The type of domain({<"Sy Snootles", 14>, <"Prince Charming", -5>}) is

Question [2].
domain({<"Guava", -9>, <"Anakin Skywalker", 0>, <"Bert", 0>}) == 



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.