Haskell multiple arguments function
<pre><code>myfunc:: [Int] -&gt; Int -&gt; Int   
myfunc mylist i =
    if length(mylist) == 0 then 1

    else
       (head(mylist) * i) +  myfunc((tail(mylist)) (i+1))
</code></pre>

<p>I want to get a weighted sum over a list.</p>

<p>for example, at given parameter <code>[10,9,8,7,6]</code> and <code>1</code>,
I want to get <code>10*1 + 9*2 + 8*3 + 7*4 + 6*5 ..</code></p>

<p>But my code puts error that</p>

<pre><code>test.hs:9:18: error:
    • Couldn't match expected type ‘Int’ with actual type ‘Int -&gt; Int’ 
</code></pre>

<p>how to fix this problem??</p>