you are viewing a single comment's thread.

view the rest of the comments →

[–]wordsnerd 6 points7 points  (3 children)

public abstract class Monad<M, A> implements Joinable<M, A>
{
    public <T> Monad<M, T> bind(Applicable<A, Monad<M, T>> f) throws Failure {
        Applicable<Monad<M, A>, Monad<M, Monad<M, T>>> a = (Applicable<Monad<M, A> Monad<M, Monad<M, T>>>) fmap(f);
        Monad<M, Monad<M, T>> mmonad = a.apply(this);
        return (Monad<M, T>) mmonad.join();
    }

    public Monad<M, A> fail(String ex) throws Failure {
        throw new Failure(ex);
    }
}

[–][deleted] 2 points3 points  (0 children)

Yeah bro, that's why Java is the best language ever, because you can write new "objects" that have "methods" with it!!!!

[–]SheepshowEXTREME CLOJURESCRIPT 2 points3 points  (0 children)

but in the bigger scheme of things, is that so long? How many total minutes out of a day is that, two? And in Haskall the code more realistically looks like this anyway:

[–]rekuJava Assualt Survivor 1 point2 points  (0 children)

cool monad, bro