Created
March 14, 2018 22:50
-
-
Save ItsDoot/09361d68f2eabd60054c58b6f51160a9 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
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> => A|B> { | |
shared formal actual A|B point<B>(B b); | |
shared formal actual A|C bind<B,C>(A|B m)(<A|C>(B) func); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment