title: Create list of case class instances
body: <p>I have 3 vals, each of type <code>Array[String]</code></p>
  
  <p>they are all equal in length</p>
  
  <p>val1.length == val2.length // true</p>
  
  <p>Next, I created a case class as following:</p>
  
  <pre><code>case class resource(name: String, count: Int, location: String)
  </code></pre>
  
  <p>I want to create a list, a <code>List[resource]</code> such that each object of this list is created from the corresponding elements of the <code>val</code>s, i.e, <code>val1</code>, <code>val2</code>, <code>val3</code></p>
  
  <p>Something like this:</p>
  
  <pre><code>val newList: List[resource] = (val1(0), val2(0).toInt, val3(0)),
                                (val1(1), val2(1).toInt, val3(1)),
                                ...
                                (val1(val1.length), val2(val2.length).toInt, val3(val3.length)
  </code></pre>
  
  <p>I'm not sure how to proceed. Do I use flatMap, foreach, for-loops, or something else?</p>
  
  <p>The idea is to create this abovementioned <code>newList</code> and compare it to the result obtained from a SQL database using doobie.</p>
  
  <pre><code>val comparator = sql"sql statment".query[resource]
  comparator.to[List].transact(xa).unsafeRunSync()
  </code></pre>