title: remove elements from a List of case class structure efficiently and elegantly
body: <p>I have a nested <code>case</code> classes structure in a <code>List</code> </p>
  
  <p>for simplicity will use following as an example - </p>
  
  <pre><code>case class Address(street: String, city: String, state: String, zipCode: Int)
  case class Person(firstName: String, lastName: String, addresses: List[Address])
  case class Department(people: List[Person])
  </code></pre>
  
  <p>say there is <code>List[Department]</code> ; now if I wan to create a new <code>List[Department]</code> by filtering <code>Address</code> for each <code>Person</code> which doesn't have a specific <code>zipCode</code> value ; traditionally we can do following</p>
  
  <pre><code>def filterPersonsByAddress(dlist: List[Department]): List[Department] = {
    dlist.map { d =&gt;
      val people = d.people.map { p =&gt; 
        p.copy(addresses = p.addresses.filterNot(_.zipCode == 38978))}
        d.copy(people=people)
      }
   }
  </code></pre>
  
  <p>This approach is not performant as depending on the nesting level it can be Big O(n^2) or Big O(n^3) ; </p>
  
  <p>I am trying to learn Lenses via <a href="https://github.com/julien-truffaut/Monocle" rel="noreferrer">Monocle</a>. So far what I have learned is Lenses is useful when you have to "modify" a deeply nested <code>case</code> class structure but haven't yet found a way to "chop off" certain part of nested structure based on a condition and return a new structure. Is this possible for via Monocle? Also I am not sure if Lenses will be able to help in achieving better Big O time as well? </p>