title: Currying 3 Arguments in Haskell
body: <p>I'm having trouble with currying a function to remove three arguments in Haskell. </p>
  
  <p>Disclaimer: Not Coursework, I was asked this question by someone struggling with this today and it's been bugging me.</p>
  
  <p>The custom types/functions we were given were (can only remember types)</p>
  
  <pre><code>type MyThing
    = (Char, String)
  type MyThings
    = [MyThing]
  
  funcA :: MyThings -&gt; String -&gt; String
  funcB :: MyThings -&gt; String -&gt; Int -&gt; String
  </code></pre>
  
  <p>We started with:</p>
  
  <pre><code>funcB as str n = iterate (funcA as) str !! n
  </code></pre>
  
  <p>And reduced it down as follows:</p>
  
  <pre><code>funcB as str n = iterate (funcA as) str !! n
  funcB as str = (!!) . (iterate (funcA as)) str
  funcB as = (!!) . (iterate (funcA as))
  funcB as = (!!) . (iterate . funcA) as
  </code></pre>
  
  <p>Then, stuck. We just can't figure out how to avoid using the last argument. I know I've seen a similar situation somewhere before and there was a solution.</p>
  
  <p>Hoping some Haskell genius can point out why I'm being an idiot...</p>