@@ -14,33 +14,32 @@ public class Maps {
1414 private Maps () {
1515 // NB: Prevent instantiation of utility class.
1616 }
17-
18- public static class Lift {
19- private Lift () {
20- }
2117
22- public static class Functions {
23- private Functions () {
24- }
25-
26- public static <I , O > Function <List <I >, List <O >> list (final Function <I , O > function ) {
27- return iter -> iter .stream ().map (function ).collect (Collectors .toList ());
28- }
18+ public interface Functions {
19+
20+ public interface Iterables {
2921
30- public static <I , O > Function <Iterable <I >, Iterable <O >> iterable (final Function <I , O > function ) {
22+ public static <I , O > Function <Iterable <I >, Iterable <O >> liftBoth (final Function <I , O > function ) {
3123 return iter -> () -> Streams .stream (iter ).map (function ).iterator ();
3224 }
3325
34- public static <I , O > Function <Iterable <I >, Iterable <O >> iterableFlat (final Function <I , Iterable <O >> function ) {
26+ public static <I , O > Function <Iterable <I >, Iterable <O >> bothFlat (final Function <I , Iterable <O >> function ) {
3527 return iter -> () -> Streams .stream (iter ).flatMap (i -> Streams .stream (function .apply (i ))).iterator ();
3628 }
3729 }
38-
39- public static class Computers {
40- private Computers () {
30+
31+ public interface Lists {
32+ public static <I , O > Function <List <I >, List <O >> liftBoth (final Function <I , O > function ) {
33+ return iter -> iter .stream ().map (function ).collect (Collectors .toList ());
4134 }
35+ }
36+ }
4237
43- public static <I , O > Computer <Iterable <I >, Iterable <O >> iterable (final Computer <I , O > computer ) {
38+ public interface Computers {
39+
40+ public interface Iterables {
41+
42+ public static <I , O > Computer <Iterable <I >, Iterable <O >> liftBoth (final Computer <I , O > computer ) {
4443 return (iter1 , iter2 ) -> {
4544 Iterator <I > i1 = iter1 .iterator ();
4645 Iterator <O > i2 = iter2 .iterator ();
0 commit comments