title: How can we emulate variadic templates in Haskell?
body: <p>In C++ we can define a function which takes a variable number of statically typed arguments, using <a href="https://en.wikipedia.org/wiki/Variadic_template" rel="nofollow">variadic templates</a>, like so:</p>
  
  <pre><code>template&lt;typename... Params&gt; void f(Params... parameters);
  </code></pre>
  
  <p>(Alternatively we could have create a struct with variadic number of fields and used that as the argument to <code>f</code>.)</p>
  
  <p>We can also use type traits to inspect the values. I would like to do something similar in Haskell.</p>
  
  <p>I'd like to define a data type and a family of functions with a parameterized number of statically typed arguments:</p>
  
  <pre><code>data T ??? = ...
  mkT :: ... -&gt; T ???
  f :: T ??? -&gt; ...
  </code></pre>
  
  <p><code>f</code> needs to be able to convert the parameter types to <em>values</em> so we can do something generic with them (think printf).</p>
  
  <p>Perhaps a job for HLists?</p>