Created
March 14, 2018 22:48
-
-
Save ItsDoot/5f083c93945f5cec634a07a7c5194915 to your computer and use it in GitHub Desktop.
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
class Either<A, B>() {} | |
interface Monad<M> given M<E> { | |
shared formal M<A> point<A>(A t) ; | |
shared formal M<B> bind<A, B>(M<A> box)(M<B>(A) func) ; | |
} | |
interface EitherMoad<A> satisfies Monad<<B> => Either<A,B>> { | |
shared formal actual Either<A,B> point<B>(B b); | |
shared formal actual Either<A,C> bind<B,C>(Either<A,B> m)(Either<A,C>(B) func); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment