Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Peaker
on May 10, 2018
|
parent
|
context
|
favorite
| on:
The Logical Disaster of Null
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)
pera
on May 11, 2018
[–]
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.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: