I have to code a function to calculate
(sum k=1 to n) (-1)^(k+1) * a_k from list
calculate list = foldl (\x xs -> x + (xs * (-1)^(??? + 1)) ) 0 list
I managed to write this code, but I don't have a clue what should replace
???, how to get index of an element in given list.