[erlang-questions] type specification of functions with same signature
Sun Oct 23 01:01:15 CEST 2016
On 10/22/2016 03:43 PM, Karlo Kuna wrote:
> sure dialyzer will report error but callback functions are just one
> motivation, for me the first example is far more important
> as it reduces spec duplication which is annoying and not very expressive
Oh, drat. Right. You want to be able to vary the names of the function.
You probably already thought about this, but how about a macro?
-define(MY_F_SPEC(Fun), -spec Fun(list(),atom())->boolean()).
foo(L, A) -> true.
bar(L, A) -> false.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: OpenPGP digital signature
More information about the erlang-questions