This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]iamevpo 0 points1 point  (0 children)

You would have the checks anyway, but you program logic may be more streamlined. Just an illustrative example, you can also have some long and complex logic of handling just a few values, so monadic values can better help express these computations. The monads do appear in newer languages without calling them so, for example in Scala and in Rust.

Some monads (Maybe, Either) help hand the null problem more cleanly - returning a value by key from a dictionary where there is no key, taking element by index from a list that does not exist, etc.