Hacker News new | ask | show | jobs
by notpushkin 62 days ago
Kinda like that, but with the error branch having a value too. I think Result is the common name for this monad:

  type Result e v = Ok v | Err e
https://en.wikipedia.org/wiki/Result_type