Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think one of the best and clearest examples of a useful monad is the Error monad in OCaml (and Haskell, I think). Error is a type that can return two different things depending on the result of a computation. One could use exceptions for this sort of thing, but this is much, much cheaper.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: