Can There be Monads in Java?

I put together a presentation on creating monads in Java.

https://docs.google.com/presentation/d/1-eVPi6lsgnHrEj6G91DgbXRkSZknCJ4evESdYccmNQE/edit?usp=sharing

Some highlights:

+ Monad: Container that allows chaining operations, preserving semantics

Normally a function maps from one type to another, but the semantics may change. With a monad, operations have the same result type, so multiple operations preserve semantics.

Safer way to enforce semantics than as conventions, and relying on out-of-channel means such as using a lead pipe.

The monad pattern is all about preserving semantics across types. So first you have to decide on some semantics. This is particularly important for this pattern, otherwise you’re just creating extra work for yourself.

Advertisements

Leave a comment

Filed under Uncategorized

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