title: replacing an element in a list of lists in haskell
body: <p>I am trying to write a function like this:</p>
  
  <pre><code>updateMatrix:: [[a]] -&gt; a -&gt; (x, y) -&gt;[[a]]
  </code></pre>
  
  <p>This is supposed to take in a list of lists such as:</p>
  
  <pre><code>[ [1, 2, 3, 4],
    [5, 6, 7, 8]]
  </code></pre>
  
  <p>and put the given element at the specified coordinates, so, given:</p>
  
  <pre><code>[ [1, 2, 3, 4],
    [5, 6, 7, 8]] 9 (0, 1)
  </code></pre>
  
  <p>it should return </p>
  
  <pre><code>[ [1, 9, 3, 4],
    [5, 6, 7, 8]]
  </code></pre>
  
  <p>I can't figure out how to do this without having to rebuild the whole matrix, please help!</p>