Hacker News new | ask | show | jobs
by vertex-four 3190 days ago
So how does knowing that Maybe is a monad solve a problem for anybody not programming Haskell?
1 comments

I guess it helps in two ways.

First, if you realize you have a computation that can either return a value or a "special" value that means it failed, you can model this using a Maybe-like data structure.

Second, if in some part of your program you are already using a data structure that is isomorphic to Maybe, you might stand to gain from using the same interface used with the Maybe monad in Haskell (or any other monad), namely 'bind' and 'return', or similar forms.