The problem with Elixir’s `with` ↦
A reasoned critique of the often lauded with
keyword that can be summarized as:
Return values from different expressions in a
with
block can only be distinguished by the shape of the data returned. This creates ambiguity inwith
’selse
clauses that make code harder to understand and more challenging to modify correctly.
The author describes the problem in detail and even provides two alternatives to with..else
that avoid the resulting ambiguity.
Discussion
Sign in or Join to comment or subscribe