/** * Creates a {@link P6} by adding the given element to the current {@link P4} * * @param el the element to append * @return A {@link P6} containing the original {@link P4} with the extra element added at the end */ public final <E, F> P6<A, B, C, D, E, F> append(P2<E, F> el) { return P.p(_1(), _2(), _3(), _4(), el._1(), el._2()); }
/** * Binds the given function to the value in a product-1 with a final join. * * @param f A function to apply to the value in a product-1. * @return The result of applying the given function to the value of given product-1. */ public final <B> P1<B> bind(final F<A, P1<B>> f) { P1<A> self = this; return P.lazy(() -> f.f(self._1())._1()); }
/** * Creates a {@link P8} by adding the given element to the current {@link P5} * * @param el the element to append * @return A {@link P8} containing the original {@link P5} with the extra element added at the end */ public final <F, G, H> P8<A, B, C, D, E, F, G, H> append(P3<F, G, H> el) { return P.p(_1(), _2(), _3(), _4(), _5(), el._1(), el._2(), el._3()); }
/** * An order instance for a product-3, with the first factor considered most significant. * * @param oa An order instance for the first factor. * @param ob An order instance for the second factor. * @param oc An order instance for the third factor. * @return An order instance for a product-3, with the first factor considered most significant. */ public static <A, B, C> Ord<P3<A, B, C>> p3Ord(final Ord<A> oa, final Ord<B> ob, final Ord<C> oc) { return on(P3.<A, B, C>__1(), oa).then(P3.__2(), ob).then(P3.__3(), oc).ord(); }
/** * Creates a {@link P8} by adding the given element to the current {@link P3} * * @param el the element to append * @return A {@link P8} containing the original {@link P3} with the extra element added at the end */ public final <D, E, F, G, H> P8<A, B, C, D, E, F, G, H> append(P5<D, E, F, G, H> el) { return P.p(_1(), _2(), _3(), el._1(), el._2(), el._3(), el._4(), el._5()); }