Skip to content

Instantly share code, notes, and snippets.

@calebh
Created July 21, 2019 00:09
Show Gist options
  • Select an option

  • Save calebh/a7ef1f4708312989d3d2db7f11937c34 to your computer and use it in GitHub Desktop.

Select an option

Save calebh/a7ef1f4708312989d3d2db7f11937c34 to your computer and use it in GitHub Desktop.

Revisions

  1. calebh created this gist Jul 21, 2019.
    7 changes: 7 additions & 0 deletions monad.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    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);
    }