title: How to write a Haskell function that takes a variadic function as an argument
body: <p>I'm trying to create a function that gets a variadic function as <em>an argument</em>, i.e.</p>
  
  <pre><code>func :: (a -&gt; ... -&gt; a) -&gt; a
  </code></pre>
  
  <p>how can I accomplish this?</p>
  
  <p>I've read about <a href="https://stackoverflow.com/questions/3467279/how-to-create-a-polyvariadic-haskell-function">polyvariadic functions</a> and I'm sure that <a href="http://okmij.org/ftp/Haskell/polyvariadic.html" rel="noreferrer">Oleg already did it</a>, however I'm lost trying to apply the pattern on a function with a variadic function as an argument. Especially Olegs approach seems to work with glasgow extensions only and I want the solution to work in pure Haskell 98 (like <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Text-Printf.html" rel="noreferrer">Text.Printf</a> does).</p>
  
  <p><strong>The reason</strong> that I ask is that I'm trying to build a function which takes a boolean function as an argument and checks whether it is a tautology, i.e.</p>
  
  <pre><code>isTautology :: (Bool -&gt; ... -&gt; Bool) -&gt; Bool
  </code></pre>
  
  <p>so that one could type:</p>
  
  <pre><code>isTautology (\x -&gt; x &amp;&amp; not x)
  isTautology (\x y -&gt; x &amp;&amp; y || not y)
  </code></pre>
  
  <p>My problem is that I keep reading about the trick was to make the return type a type variable (so that it can be the result or another function), but my return type is fixed (Bool).</p>