title: How to typespec generics in Elixir
body: <p>I have an implementation of a Balanced Search Tree in elixir which serves as a key value store. </p>
  
  <p>I have a method <code>from_list</code> which takes a list of key value tuples and returns a tree with them. Is there a way to use generics to typespec this the way I would do in a strongly typed language?</p>
  
  <pre><code>@spec from_list([{key_type, value_type}]) :: tree(key_type, value_type)
  def from_list(list), do: 
  </code></pre>
  
  <p>When I try this I get an error. Are there generics in Elixir? Or do I have to just make it a list of type {any, any}?</p>