You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently working on a project , that needs to recursively split the input data to several categories.
Using ParallelIterator::partition_map i can split the input data into 2, but this is not recursive,
If for example I return Either<Either<A,B>,C> from my iterator, I am unable to partition the data into
((Vec<A>,Vec<B>),Vec<C>).
So far I have been unable to implement this on my own, and would appreciate help.
My idea was to implement this trait for tuples, something like this
impl<R, S, T> ParallelExtend<T> for (R, S)
where R: ParallelExtend<T>,
S: ParallelExtend<T>
{
fn par_extend<I>(&mut self, par_iter: I) where I: IntoParallelIterator<Item=Either<R, S>> {
}
}
I need this functionality to partition the input data into several containers with heterogenous types, and do it as fast as possible.
The text was updated successfully, but these errors were encountered:
604: impl ParallelExtend for tuple pairs r=nikomatsakis a=cuviper
`ParallelExtend<(A, B)>` and `ParallelExtend<Either<L, R>>` for tuples
behave like `unzip` and `partition_map` respectively. These allow the
possibility of nested `unzip` and `partition_map` operations, filling
into more than just two collections. For instance, `(A, (B, C))` items
can be unzipped into `(Vec<A>, (Vec<B>, Vec<C>))`.
Fixes#600.
Co-authored-by: Josh Stone <cuviper@gmail.com>
I am currently working on a project , that needs to recursively split the input data to several categories.
Using ParallelIterator::partition_map i can split the input data into 2, but this is not recursive,
If for example I return Either<Either<A,B>,C> from my iterator, I am unable to partition the data into
((Vec<A>,Vec<B>),Vec<C>).
So far I have been unable to implement this on my own, and would appreciate help.
My idea was to implement this trait for tuples, something like this
I need this functionality to partition the input data into several containers with heterogenous types, and do it as fast as possible.
The text was updated successfully, but these errors were encountered: