3 ms·
So how does knowing that Maybe is a monad solve a problem for anybody not programming Haskell?
by vertex-four 9y ago
So how does knowing that Maybe is a monad solve a problem for anybody not programming Haskell?
- hikarudo 9y agoI 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.