title: Use a tuple as arguments for a function in Elixir
body: <p>I'm writing a game engine in Elixir. (Yes, I know it's not a language inherently suited to that – the point is to look at how the use of an atypical language affects the structure of the result.)</p>
  
  <p>As such, I have several supervisors to be run on game start – but what exactly they should be supervising depends on the game. My thought had been to have the user list out the necessary children, plus arguments and options, in the <code>config.exs</code> file as a list of tuples, and then the supervisor itself would simply pull those tuples from the application environment and use their contents as arguments to <code>worker\2</code> (or <code>worker\3</code>, as appropriate).</p>
  
  <p>However, I can't find any Elixir equivalent to Python's tuple-unpacking. I could do it myself for this specific case with a simple function:</p>
  
  <pre><code>def unpack_worker({module, args}) do
    worker(module, args)
  end
  
  def unpack_worker({module, args, opts}) do
    worker(module, args, opts)
  end
  </code></pre>
  
  <p>But that feels clumsy at best, and would have to be written again for every function for which I might need this kind of configurability.</p>