title: Updating a list of elements within a list?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5860482/update-a-list-of-a-list-of-elements-in-a-single-list">Update a list of a list of elements in a single list?</a>  </p>
  </blockquote>
  
  
  
  <p>I have a list of values as shown below:</p>
  
  <pre><code>[ ["Off","Off","Off"],
    ["Off","Off","Off"],
    ["Off","Off","Off"] ]
  </code></pre>
  
  <p>and would like to return the following:</p>
  
  <pre><code>[ ["Off","Off","Off"],
    ["Off",*"On"*,"Off"],
    ["Off","Off","Off"] ]
  </code></pre>
  
  <p>I have the following function which works just for an individual list by itself:</p>
  
  <pre><code>replaceAll 0 newValue (x:xs) = newValue:xs
  replaceAll b newValue (x:xs) = x:replaceAll (b-1) newValue xs
  </code></pre>
  
  <p>However, I seem to be having trouble working with these multiple lists within a list. How would I devise a function to deal with these two lists (i.e. a list inside another list)? </p>
  
  <p>Still trying to get my head around the whole (x:xs) thing.</p>