News for hackers. Stuff that matters.
Re:Language Design Deal Breakers by gizmo686 on Sunday May 26, 2013 @01:03AM (#5770104)
I've never used OCaml, but Haskell isn't as bad as you describe. When you use Maybe, you do not have to deal with the Nothing (ie. Null) case until you want to escape the monad (even then, you could still ignore it, and just crash if you do have Nothing).

If an intermediate calculation results in Nothing, then the final value will be Nothing. Handling this is as simple as:

foo :: Maybe Int -> Int

foo Nothing = 0

foo (Just x) = x

There are no comments on this comment yet.