Skip to content

Instantly share code, notes, and snippets.

@ItsDoot
Created March 14, 2018 22:50
Show Gist options
  • Save ItsDoot/09361d68f2eabd60054c58b6f51160a9 to your computer and use it in GitHub Desktop.
Save ItsDoot/09361d68f2eabd60054c58b6f51160a9 to your computer and use it in GitHub Desktop.
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