title: Multiple specifications for same function in Erlang header file
body: <p>I'm trying to specify a function in a header file.
  Like so:</p>
  
  <pre><code>-spec update(pid(), tuple(tuple(), integer(), atom()), tuple(atom(), atom())) -&gt; tuple(tuple(), integer(), atom()).
  </code></pre>
  
  <p>Now I want to add some extra specification for this function because it has multiple different parameters.</p>
  
  <pre><code>update(_Pid, {Specs, infinity, _State}, {Step}) -&gt;
    timer:sleep(10000),
    {{Specs, infinity}, {Step}};
  update(_Pid, {Specs, infinity, _State}, {ExtraInfo, Step}) -&gt;
    timer:sleep(10000),
    {{Specs, infinity}, {ExtraInfo, Step}};
  update(_Pid, {Specs, N, _State}, _Info) when N &lt; 2 -&gt;
    {Specs, N, stop};
  update(_Pid, {Specs, N, _State}, {notTaken, Step}) -&gt;
    {Specs, N, Step};
  update(_Pid, {Specs, N, _State}, {taken, Step}) -&gt;
    {Specs, N - 1, Step}.
  </code></pre>
  
  <p>So I want to add these extra specifications, for the different parameters in this function, in my header file. I don't know how to do this, could someone help me with this?</p>
  
  <p>I tried to do this but it gives me compilation errors:</p>
  
  <pre><code>-spec update(pid(), tuple(tuple(), integer(), atom()), tuple(atom(), atom())) -&gt; tuple(tuple(), integer(), atom()).
  -spec update(pid(), tuple(tuple(), atom(), atom()), tuple(integer(), atom())) -&gt; tuple(tuple(), atom(), atom()).
  -spec update(pid(), tuple(tuple(), atom(), atom()), tuple(atom())) -&gt; tuple(tuple(), atom(), atom()).
  </code></pre>
  
  <p>Thanks in advance.</p>