Skip to content

Instantly share code, notes, and snippets.

@calebh
Created July 21, 2019 00:09
Show Gist options
  • Save calebh/a7ef1f4708312989d3d2db7f11937c34 to your computer and use it in GitHub Desktop.
Save calebh/a7ef1f4708312989d3d2db7f11937c34 to your computer and use it in GitHub Desktop.
typeclass Monad<m> {
m<b> >>= <a, b>(m<a>, Func<a, m<b>>);
m<b> >> <a, b>(m<a> x, m<b> y) {
return >>= <a, b>(x, (ignored) => y);
}
m<a> return_ <a>(a);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment