<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> -spec bar(fun((integer()) -> integer()) | fun((atom()) -> atom())) -> ok.<br class="gmail_msg">
> %% Allows fun erlang:atom_to_list/1, which doesn't work on integers at all.<br class="gmail_msg">
<br class="gmail_msg">
I'm seriously confused as I do not see anything related to lists here...<br class="gmail_msg">
<br class="gmail_msg">
Can you elaborate?<br class="gmail_msg"><br class="gmail_msg"></blockquote><div><br></div><div>I'm sorry, editing mistake! atom_to_list is of course not a good example. (I started off with different code samples and edited them a couple of times.)</div><div><br></div><div>The correct example would be a function that only takes atoms and returns atoms. E.g.</div><div><br></div><div><font face="monospace">good_example(ok) -> ok;</font></div><div><font face="monospace">good_example(Other) when is_atom(Other) -> error.</font></div></div></div>