Navigation
Synopsis Invert the tuples in a relation.
Function
  1. rel[&T1, &T0] invert (rel[&T0, &T1] R)
  2. rel[&T2, &T1, &T0] invert (rel[&T0, &T1, &T2] R)
  3. rel[&T3, &T2, &T1, &T0] invert (rel[&T0, &T1, &T2, &T3] R)
  4. rel[&T4, &T3, &T2, &T1, &T0] invert (rel[&T0, &T1, &T2, &T3, &T4] R)
Usage import Relation;
Examples
rascal>import Relation;
ok
rascal>invert({<1,10>, <2,20>});
rel[int,int]: {
  <10,1>,
  <20,2>
}

Questions
Question [1].
The type of invert({<-5, "Telly Monster">}) is

Question [2].
invert({<-18, -20>, <3, -7>, <-15, 17>, <-12, -4>}) == 



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.