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

This is great. I hope this finds its way to Elixir land.


It is already there with the "with" macro.

The EEP doc calls it out:

https://www.erlang.org/eeps/eep-0049#elixir

"This is the most general control flow in this document, being fully flexible with regards to which values it can handle. This was done in part because there is not a strong norm regarding error or valid values in either the Erlang nor Elixir APIs, at least compared to other languages here.

This high level of flexibility has been criticized in some instances as being a bit confusing: it is possible for users to make error-only flows, success-only flows, mixed flows, and consequently the ˋelseˋ clause can become convoluted."


This already exist with the `with` expression, no?


Yeah, `with` is pretty much this.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

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

Search: