2018-05-17 16:07:21 +00:00
|
|
|
import java.lang.String;
|
2017-06-12 16:57:12 +00:00
|
|
|
|
|
|
|
public class Lambda2
|
|
|
|
{
|
|
|
|
/*
|
|
|
|
public static <A> List<A> map(List<? extends A> input,
|
|
|
|
Function<? super A, ? extends A> func){
|
|
|
|
input.add(func.apply(input.get()));
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
public map(input,func){
|
|
|
|
input.add(func.apply(input.get()));
|
|
|
|
return map(new List<String>(), func);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class List<A>{
|
|
|
|
A get();
|
|
|
|
void add(A);
|
|
|
|
}
|
|
|
|
|
|
|
|
class Function<A,B>{
|
|
|
|
B apply(A a);
|
|
|
|
}
|