|
1 | 1 | package com.jnape.palatable.lambda.functions.builtin.fn2; |
2 | 2 |
|
3 | | -import com.jnape.palatable.lambda.adt.hlist.Tuple3; |
| 3 | +import com.jnape.palatable.lambda.adt.product.Product3; |
4 | 4 | import com.jnape.palatable.lambda.functions.Fn1; |
5 | 5 | import com.jnape.palatable.lambda.functions.Fn2; |
6 | 6 | import com.jnape.palatable.lambda.functions.Fn3; |
7 | 7 |
|
8 | 8 | /** |
9 | | - * Given an <code>{@link Fn3}<A, B, C, D></code> and a <code>{@link Tuple3}<A, B, C></code>, destructure the |
10 | | - * tuple and apply the slots as arguments to the function, returning the result. |
| 9 | + * Given an <code>{@link Fn3}<A, B, C, D></code> and a <code>{@link Product3}<A, B, C></code>, destructure |
| 10 | + * the product and apply the slots as arguments to the function, returning the result. |
11 | 11 | * |
12 | 12 | * @param <A> the first argument type |
13 | 13 | * @param <B> the second argument type |
14 | 14 | * @param <C> the third argument type |
15 | 15 | * @param <D> the result type |
16 | 16 | */ |
17 | | -public final class Into3<A, B, C, D> implements Fn2<Fn3<? super A, ? super B, ? super C, ? extends D>, Tuple3<A, B, C>, D> { |
| 17 | +public final class Into3<A, B, C, D> implements Fn2<Fn3<? super A, ? super B, ? super C, ? extends D>, Product3<A, B, C>, D> { |
18 | 18 |
|
19 | 19 | private static final Into3 INSTANCE = new Into3(); |
20 | 20 |
|
21 | 21 | @Override |
22 | | - public D apply(Fn3<? super A, ? super B, ? super C, ? extends D> fn, Tuple3<A, B, C> tuple) { |
23 | | - return tuple.into(fn); |
| 22 | + public D apply(Fn3<? super A, ? super B, ? super C, ? extends D> fn, Product3<A, B, C> product) { |
| 23 | + return product.into(fn); |
24 | 24 | } |
25 | 25 |
|
26 | 26 | @SuppressWarnings("unchecked") |
27 | 27 | public static <A, B, C, D> Into3<A, B, C, D> into3() { |
28 | 28 | return INSTANCE; |
29 | 29 | } |
30 | 30 |
|
31 | | - public static <A, B, C, D> Fn1<Tuple3<A, B, C>, D> into3(Fn3<? super A, ? super B, ? super C, ? extends D> fn) { |
| 31 | + public static <A, B, C, D> Fn1<Product3<A, B, C>, D> into3(Fn3<? super A, ? super B, ? super C, ? extends D> fn) { |
32 | 32 | return Into3.<A, B, C, D>into3().apply(fn); |
33 | 33 | } |
34 | 34 |
|
35 | | - public static <A, B, C, D> D into3(Fn3<? super A, ? super B, ? super C, ? extends D> fn, Tuple3<A, B, C> tuple) { |
36 | | - return Into3.<A, B, C, D>into3(fn).apply(tuple); |
| 35 | + public static <A, B, C, D> D into3(Fn3<? super A, ? super B, ? super C, ? extends D> fn, |
| 36 | + Product3<A, B, C> product) { |
| 37 | + return Into3.<A, B, C, D>into3(fn).apply(product); |
37 | 38 | } |
38 | 39 | } |
0 commit comments