Last active
August 29, 2015 14:21
-
-
Save danieldietrich/2f7244a36065a3b4fc65 to your computer and use it in GitHub Desktop.
Higher-Kinded Types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Monad<T> { | |
<U> Monad<U> flatMap(Function<? super T, ? extends Monad<U>> mapper); | |
} | |
interface Tree<T> extends Monad<T> { | |
@Override | |
<U> Tree<U> flatMap(Function<? super T, ? extends Tree<U>> mapper); | |
} | |
interface BinaryTree<T> extends Tree<T> { | |
@Override | |
<U> BinaryTree<U> flatMap(Function<? super T, ? extends BinaryTree<U>> mapper); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment