Class Partition<A,B,C>
java.lang.Object
com.jnape.palatable.lambda.functions.builtin.fn2.Partition<A,B,C>
- Type Parameters:
A
- A type contravariant to the input Iterable element typeB
- The output left Iterable element type, as well as the CoProduct2 A typeC
- The output right Iterable element type, as well as the CoProduct2 B type
- All Implemented Interfaces:
Fn1<Fn1<? super A,
,? extends CoProduct2<B, C, ?>>, Fn1<Iterable<A>, Tuple2<Iterable<B>, Iterable<C>>>> Fn2<Fn1<? super A,
,? extends CoProduct2<B, C, ?>>, Iterable<A>, Tuple2<Iterable<B>, Iterable<C>>> Applicative<Fn1<Iterable<A>,
,Tuple2<Iterable<B>, Iterable<C>>>, Fn1<Fn1<? super A, ? extends CoProduct2<B, C, ?>>, ?>> Cartesian<Fn1<? super A,
,? extends CoProduct2<B, C, ?>>, Fn1<Iterable<A>, Tuple2<Iterable<B>, Iterable<C>>>, Fn1<?, ?>> Cocartesian<Fn1<? super A,
,? extends CoProduct2<B, C, ?>>, Fn1<Iterable<A>, Tuple2<Iterable<B>, Iterable<C>>>, Fn1<?, ?>> Contravariant<Fn1<? super A,
,? extends CoProduct2<B, C, ?>>, Profunctor<?, Fn1<Iterable<A>, Tuple2<Iterable<B>, Iterable<C>>>, Fn1<?, ?>>> Functor<Fn1<Iterable<A>,
,Tuple2<Iterable<B>, Iterable<C>>>, Fn1<Fn1<? super A, ? extends CoProduct2<B, C, ?>>, ?>> Profunctor<Fn1<? super A,
,? extends CoProduct2<B, C, ?>>, Fn1<Iterable<A>, Tuple2<Iterable<B>, Iterable<C>>>, Fn1<?, ?>> Monad<Fn1<Iterable<A>,
,Tuple2<Iterable<B>, Iterable<C>>>, Fn1<Fn1<? super A, ? extends CoProduct2<B, C, ?>>, ?>> MonadReader<Fn1<? super A,
,? extends CoProduct2<B, C, ?>>, Fn1<Iterable<A>, Tuple2<Iterable<B>, Iterable<C>>>, Fn1<Fn1<? super A, ? extends CoProduct2<B, C, ?>>, ?>> MonadRec<Fn1<Iterable<A>,
,Tuple2<Iterable<B>, Iterable<C>>>, Fn1<Fn1<? super A, ? extends CoProduct2<B, C, ?>>, ?>> MonadWriter<Fn1<? super A,
? extends CoProduct2<B, C, ?>>, Fn1<Iterable<A>, Tuple2<Iterable<B>, Iterable<C>>>, Fn1<Fn1<? super A, ? extends CoProduct2<B, C, ?>>, ?>>
public final class Partition<A,B,C>
extends Object
implements Fn2<Fn1<? super A,? extends CoProduct2<B,C,?>>,Iterable<A>,Tuple2<Iterable<B>,Iterable<C>>>
Given an
Iterable<A>
as
and a disjoint mapping function a ->
CoProduct2<A, B>
, return a Tuple2
over the lazily unwrapped left A
and right
B
values in the first and second slots, respectively. Note that while the tuple must be constructed
eagerly, the left and right iterables contained therein are both lazy, so comprehension over infinite iterables is
supported.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncheckedApply
(Fn1<? super A, ? extends CoProduct2<B, C, ?>> function, Iterable<A> as) static <A,
B, C> Partition <A, B, C> partition
(Fn1<? super A, ? extends CoProduct2<B, C, ?>> function) partition
(Fn1<? super A, ? extends CoProduct2<B, C, ?>> function, Iterable<A> as) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jnape.palatable.lambda.functions.Fn1
andThen, carry, cartesian, censor, choose, cocartesian, diMap, diMapR, discardL, flatMap, fmap, lazyZip, listens, local, pure, self, thunk, toFunction, trampolineM, zip, zip
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
Partition
private Partition()
-
-
Method Details