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

This style of programming has existed for about as long as Python has, and has seen substantial improvements both in classical environments (ML & Haskell) and experimental environments (Idris and Agda).

It's also increasingly popular in languages with less exclusively academic DNA. Swift's community is considering adopting a moral equivalent. Rust uses a very Haskell-ish variant. Golang uses a related variety cribbed from Common Lisp called "product-type errors" (as opposed to "sum-type errors" used here).

If this is a fad, then so is Python, Golang, and Java.



Common Lisp multiple values are not used for error handling as far as idiomatic code is concerned. The also work differently, being symetrical to optional parameters.


It's not common, but it's doable and Golang copied the approach for its error handling, which is what I was referring to more directly.

But, people absolutely use MVB in cases where an ADT would work. Especially in FFIs where CL's restarts would make the underlying bindings way more complex or underperform. I can go find some examples when I'm off hours, if you like.




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

Search: