Class Partition<A,​B,​C>

  • Type Parameters:
    A - A type contravariant to the input Iterable element type
    B - The output left Iterable element type, as well as the CoProduct2 A type
    C - 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<java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>>>, Fn2<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>>, Applicative<Fn1<java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>>,​Fn1<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​?>>, Cartesian<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​Fn1<java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>>,​Fn1<?,​?>>, Cocartesian<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​Fn1<java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>>,​Fn1<?,​?>>, Contravariant<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​Profunctor<?,​Fn1<java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>>,​Fn1<?,​?>>>, Functor<Fn1<java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>>,​Fn1<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​?>>, Profunctor<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​Fn1<java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>>,​Fn1<?,​?>>, Monad<Fn1<java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>>,​Fn1<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​?>>, MonadReader<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​Fn1<java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>>,​Fn1<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​?>>, MonadRec<Fn1<java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>>,​Fn1<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​?>>, MonadWriter<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​Fn1<java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>>,​Fn1<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​?>>

    public final class Partition<A,​B,​C>
    extends java.lang.Object
    implements Fn2<Fn1<? super A,​? extends CoProduct2<B,​C,​?>>,​java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.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:
    CoProduct2
    • Field Detail

      • INSTANCE

        private static final Partition<?,​?,​?> INSTANCE
    • Constructor Detail

      • Partition

        private Partition()
    • Method Detail

      • checkedApply

        public Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>> checkedApply​(Fn1<? super A,​? extends CoProduct2<B,​C,​?>> function,
                                                                                      java.lang.Iterable<A> as)
        Specified by:
        checkedApply in interface Fn2<A,​B,​C>
      • partition

        public static <A,​B,​C> Partition<A,​B,​C> partition()
      • partition

        public static <A,​B,​C> Fn1<java.lang.Iterable<A>,​Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>>> partition​(Fn1<? super A,​? extends CoProduct2<B,​C,​?>> function)
      • partition

        public static <A,​B,​C> Tuple2<java.lang.Iterable<B>,​java.lang.Iterable<C>> partition​(Fn1<? super A,​? extends CoProduct2<B,​C,​?>> function,
                                                                                                              java.lang.Iterable<A> as)