title: Performing side effects using scala cats effect
body: <p>I'm trying to use cats effect in scala and in the end of the world I have the type:
  <code>IO[Vector[IO[Vector[IO[Unit]]]]]</code></p>
  
  <p>I found only one method to run it:</p>
  
  <pre><code>for {
      row &lt;- rows.unsafeRunSync()
  } yield
   for {
     cell &lt;- row.unsafeRunSync()
   } yield cell.handleErrorWith(errorHandlingFunc).unsafeRunSync()
  </code></pre>
  
  <p>But it looks pretty ugly. Please help me to understand how I can perform complex side effects.</p>
  
  <p>UPDATE:</p>
  
  <p>1)First <code>IO</code> - I open excel file and get the vector of rows i.e <code>IO[Vector[Row]]</code>.</p>
  
  <p>2)Second <code>IO</code> - I perform query to DB for each row. I can't compose IO monad with <code>Vector[_]</code>,</p>
  
  <p>3)Third <code>IO</code> - I create PDF file for each row from excel using <code>Vector[Results]</code> from DB.</p>
  
  <p>So I have such functions as:</p>
  
  <p>1) <code>String=&gt;IO[Vector[Row]]</code></p>
  
  <p>2) <code>Row=&gt;IO[Vector[Results]]</code></p>
  
  <p>3) <code>Vector[Results] =&gt; IO[Unit]</code> </p>