News for hackers. Stuff that matters.
Re:IO Monad Considered Harmful by kazagistar on Friday January 23, 2015 @01:02PM (#8936248)
The fundamental problem is higher order types. When you define an interface in Java or C#, it has no way of referring to itself. Something like "compareTo" cannot say "the other type must be exactly equal to this". So lets invent such a syntax (using a keyword "as") and write the Monad interface:

    interface Monad as m {
        const m<b> bind<a,b>(m<a>, Function<a,m<b>>);
        const m<a> return<a>(a);
    }
If you fill in the implementing class for m (like IO or List or Maybe), you get the actual type signatures that would maybe be valid in C# or something.

There are no comments on this comment yet.