4 ms·
In addition to what has being said, if you are a Java developer, then this article will be helpful for the understanding: https://www.sitepoint.com/how-optional
by valenterry 5y ago
In addition to what has being said, if you are a Java developer, then this article will be helpful for the understanding: https://www.sitepoint.com/how-optional-breaks-the-monad-laws-and-why-it-matters/ https://www.sitepoint.com/how-optional-breaks-the-monad-laws...
It gives a lot of theoretical background, but if you read the article here and already know the Optional-type and then you can skip it and go directly to "A Real World Example".
- MichaelMoser123 5y agothanks! this link should have been the main news; so much easier to think of 'unit' as object constructor, and of 'bind' as flatmap; the article also does a great job of explaining the purpose of the monad laws.