Skip to content

Instantly share code, notes, and snippets.

@cocoatomo
Created October 4, 2015 17:18
Show Gist options
  • Save cocoatomo/46802b41659e9055bd57 to your computer and use it in GitHub Desktop.
Save cocoatomo/46802b41659e9055bd57 to your computer and use it in GitHub Desktop.
package co.coatomo.math.categorical.typeclass.functor;
import java.util.function.Function;
interface FailedFunctor<A> {
<F extends FailedFunctor, B> F<B> map(Function<A, B> morphism);
}
$ javac -d /tmp co/coatomo/math/categorical/typeclass/functor/FailedFunctor.java
co/coatomo/math/categorical/typeclass/functor/FailedFunctor.java:7: error: unexpected type
<F extends FailedFunctor, B> F<B> map(Function<A, B> morphism);
^
required: class
found: type parameter F
where F is a type-variable:
F extends FailedFunctor declared in method map
1 error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment