title: Library function to compose a function with itself n times
body: <p>Is there a library function available in Haskell to compose a function with itself <em>n</em> times?</p>
  
  <p>For example I have this function:</p>
  
  <pre><code>func :: a -&gt; a
  </code></pre>
  
  <p>and I want to do this:</p>
  
  <pre><code>func . func . func . func . func . func , ... 
  </code></pre>
  
  <p>(up to <em>n</em> times, where <em>n</em> is only known at runtime).</p>
  
  <p>Note that the iterate function would not be appropriate for what I am doing, since I do not care about any intermediate results.</p>