I am trying to find how to create a tuple of lists from a list of tuples. for example
f(list<tuple<u,v>>) => tuple<list<u>,list<v>>
This use case does not appear to be accommodated well by the standard API.
Other articles say to use reduce
, but this does not work since it will only return the same type as the input type.
In .net I would use Enumerable.Aggregate
to achieve this.
Is there a functional way to achieve this in java?