Hacker News new | ask | show | jobs
by Peaker 2961 days ago
That's the Maybe type. The Maybe monad is this:

  instance Monad Maybe where
    return = Just
    Nothing >>= _ = Nothing
    Just x >>= f = f x
(And is not really related to the discussion)
1 comments

Right! that definition was the type, thanks for the correction :) still, the Maybe monad is used for computations that may fail, which is often the purpose of the null pointer.