unzip2<A, B> function
Splits pairs into two lists: first elements and second elements.
Implementation
(List<A>, List<B>) unzip2<A, B>(List<(A, B)> pairs) {
final List<A> a = <A>[];
final List<B> b = <B>[];
for (final (A x, B y) in pairs) {
a.add(x);
b.add(y);
}
return (a, b);
}