Navigation
Synopsis Make a pair (triple) of lists from a list of pairs (triples).
Function
  1. tuple[list[&T],list[&U]] unzip(list[tuple[&T,&U]] lst)
  2. tuple[list[&T],list[&U],list[&V]] unzip(list[tuple[&T,&U,&V]] lst)
Usage import List;
Description Also see unzip;
Examples
rascal>import List;
ok
rascal>unzip([<3,"thirty">, <1,"ten">, <4,"forty">]);
tuple[list[int],list[str]]: <[3,1,4],["thirty","ten","forty"]>
rascal>unzip([<3,"thirty",300>, <1,"ten",100>, <4,"forty",400>]);
tuple[list[int],list[str],list[int]]: <[3,1,4],["thirty","ten","forty"],[300,100,400]>

Questions
Question [1].
The type of unzip([<11,-19>,<8,16>,<-17,-14>,<0,-14>]) is

Question [2].
unzip([<-4,-11>,<19,2>,<-17,-1>,<-14,19>]) == 



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.