title: Haskell, Applying function to each item in a list
body: <p>hey there another haskell question i have a function of type 
     f :: CSP -> Assignment -> Var -> Int -> CSP</p>
  
  <p>i want to write a function with the type </p>
  
  <p>g :: CSP -> Assignment -> Var -> [Int] -> CSP </p>
  
  <p>which applies the original function to all of the elements in the list <code>[Int]</code>. The <code>CSP</code> that it is passed should be updated each time <code>f</code> is applied, the <code>Assigment</code> will stay the same as will the <code>Var</code>. I'm pretty sure I need to use a fold but I really don't understand them.  I'd really appreciate it if somebody could help me out and maybe try and explain folds.</p>