join

Apparently useful in case of monads. If you have a MonadX<MonadX<A>>, it will simplify it at MonadX<A> for you.

In the case of the [in]famous Maybe monad, all Haskell sites out there explain that Just<Nothing<A>> = Nothing<A> and that Just<Just<A>> is Just<A>. So what?

By implementing correctly the couple unit+bind I have been able to avoid any possible situation in which this join is needed. Moreover, it seems to me that Java is unable to handle a check like

A instanceof Just<?>

which is the heart of an implementation of join.

If anyone will be able to provide me with a real-world problem needing join in order to be solved, I will investigate the matter further.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s