title: Don't know where to start with mutable Vectors
body: <p>I am trying to do something like this in Haskell using the Data.Vector.* packages, and I really have no idea where to start.  I'm a newb to Haskell, with a tenuous grasp of certain core concepts (but I'm getting there).</p>
  
  <p>What I'm trying to do can be expressed approximately by the following C code:</p>
  
  <pre><code>float *arrA = /* initialized to array of length n */;
  float *arrB = /* initialized to array of length n */;
  for (i = 1; i &lt; n; i++) {
    for (j = 0; j &lt; n - i; j++) {
      arrB[j] = someFn(i, j, arrA[j], arrB[j+1])
    }
    float *p = arrA;
    arrA = arrB;
    arrB = p;
  }
  return arrA[0];
  </code></pre>
  
  <p>Points to note:</p>
  
  <ul>
  <li>Reuse of arrays for performance reasons, but I need two of them to avoid trampling required values for the next iteration</li>
  <li>Arrays are swapped</li>
  <li>Upper bound of inner loop changes with each iteration of outer loop</li>
  </ul>
  
  <p>Any help that you might offer would be greatly appreciated.</p>