do not apply substitutor twice (IDEA-101752)

This commit is contained in:
anna
2013-02-25 18:44:14 +01:00
parent b562064e02
commit 33a583584b
3 changed files with 33 additions and 1 deletions
@@ -0,0 +1,22 @@
public interface Iso<T, R> {
T deply(R r);
default Iso<R, T> inverse() {
final Iso<T, R> z = this;
return new Iso<R, T>() {
@Override
public R deply(T t) {
throw null;
}
};
}
static <T, R> Iso<R, T> inverse(Iso<T, R> z) {
return new Iso<R, T>() {
@Override
public R deply(T t) {
throw null;
}
};
}
}