Skip to content

Instantly share code, notes, and snippets.

@soenkehahn
Created April 20, 2016 02:43
Show Gist options
  • Save soenkehahn/a72fcbe0afe8b83609dd9220f86cb0ca to your computer and use it in GitHub Desktop.
Save soenkehahn/a72fcbe0afe8b83609dd9220f86cb0ca to your computer and use it in GitHub Desktop.
package shahn.test;
import java.util.function.BiFunction;
import java.util.function.Function;
public class Fix<X, Y> {
Function<X, Y> result;
public static <A, B> Function<A, B> fix(BiFunction<Function<A, B>, A, B> f) {
Fix<A, B> fix = new Fix<>();
fix.result = (a) -> {
return f.apply(fix.result, a);
};
return fix.result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment