<div dir="ltr"><div><div><div><div><div><div><div><div>Is there any better documentation of type defs and specs than that which occurs in the Erlang Reference manual? If so where is it?<br><br></div>I am trying to define an equivalent type/spec syntax for LFE so I am going through the valid syntax then trying to work out what they mean. And there is a lot of strangeness from simple things like the predefined type names are 'reserved' so this is valid:<br><br></div>-type atom(X) :: list(X).<br><br></div>(whatever it means) to much more strange things like:<br><br>-spec foo(Y) -> integer() when atom(Y).<br>-spec foo(Y) -> integer() when atom(Y :: integer()).<br><br></div>(whatever they mean) neither of which are mentioned in the docs.<br><br></div>So is there a more complete and understandable documentation some where?<br><br></div>Robert<br><br></div>P.S. I am a bad boy with types and really only use specs for saying a function never returns to keep dialyzer quiet. :-)<br><br></div>-spec generate_a_foo_error(any()) -> no_return().<br><br></div>