Skip to content

Instantly share code, notes, and snippets.

@nicball
nicball / Cont.java
Created February 26, 2017 06:33
Continuation monad in Java
import java.util.function.Function;
import java.util.function.Consumer;
public class Cont<R, T> {
private final Function<Function<T, R>, R> cont;
public Cont(Function<Function<T, R>, R> k) {
cont = k;
}