<div dir="ltr">If you refer to that whole line you quoted, then no, that's a "type declaration". "Index" and "SecondaryKey" are just names that act as placeholders, and since there is no other type information along with them, those fields could have any type.<div><br></div><div>A "type variable" is a variable used as a parameter of the declared type, as in this example (see section 7.3 in the link you included):<div><span style="color:rgb(0,0,0);font-family:courier,monospace;font-size:medium"><br></span></div><font face="monospace, monospace">-type orddict(Key, Val) :: [{Key, Val}].</font><div><br></div><div>Here, Key and Val are both type variables. You could for exampe use this to define another type, like so:</div><div><br></div><div><span style="font-family:monospace,monospace">-type my_dict() :: orddict(atom(), integer()).</span><br></div><div><br></div></div><div class="gmail_extra"><div><div class="gmail_signature" data-smartmail="gmail_signature"><br>        /Richard</div></div>
<br><div class="gmail_quote">2017-01-24 23:02 GMT+01:00 Raghav Karol <span dir="ltr"><<a href="mailto:raghav.karol@gmail.com" target="_blank">raghav.karol@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><font face="monospace, monospace">I recently came across this type specification </font><div><div>
</div></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">-type index_spec() :: {add, Index, SecondaryKey} | {remove, Index, SecondaryKey}.<br></font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">* Is this a `type variable', see [1] and how does one interpret it? </font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">Best,</font></div><div><font face="monospace, monospace">Raghav</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">[1] </font><span style="font-family:monospace,monospace"><a href="http://erlang.org/doc/reference_manual/typespec.html" target="_blank">http://erlang.org/doc/<wbr>reference_manual/typespec.html</a></span></div></div>
<br>______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/<wbr>listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div></div>