Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Output<T>{
- private final char c;
- private final T next;
- private Output(final char c, final T next) {
- this.c = c;
- this.next = next;
- }
- }
- public class OutputFunctor implements Functor<Output>{
- @Override
- public <R> Output<R> map(final Function<? super T, ? extends R> f,Output<T> output) {
- return new Output<>(c, f.apply(next));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement