> On Jun 25, 2019, at 22:15, José Valim <
jose....@plataformatec.com.br> wrote:
>
> It is completely fine to have the discussion here. My point was only that there is quite more work to be done in order to consider this a proposal and this is a complex topic, so the engagement may be poor until more information is available.
Thanks for the clarification (and cautionary advice :-).
Thinking a bit harder about the issue, I realize that my typical use case involves
defining lambdas, binding them to names, and then passing them into functions that
are embedded in pipelines, eg:
review_fn = fn {path, _title, _precis} -> ...
...
|> Enum.filter(review_fn)
In this scenario, I can't think of any reasonable way for the compiler to check
the lambda's arity, let alone its argument types. However, it does seem that a
tool such as Dialyzer should be able to detect some discrepancies.
So, as a test, I tried adding another parameter to the lambda definition:
review_fn = fn {path, _title, _precis, _foo} -> ...
However, Dialyzer did not detect this. Can someone explain why this might be and
whether this reflects a fundamental limitation of some sort?
-r