title: Keeping an index with flatMap in Swift
body: <p>This is a follow-up to this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/40196077/flatmap-and-ambiguous-reference-to-member-error">flatMap and `Ambiguous reference to member` error</a></p>
  
  <p>There I am using the following code to convert an array of <code>Record</code>s to an array of <code>Person</code>s:</p>
  
  <pre><code>let records = // load file from bundle
  let persons = records.flatMap(Person.init)
  </code></pre>
  
  <p>Since this conversion can take some time for big files, I would like to monitor an index to feed into a progress indicator.</p>
  
  <p>Is this possible with this <code>flatMap</code> construction? One possibility I thought of would be to send a notification in the init function, but I am thinking counting the records is also possible from within <code>flatMap</code> ? </p>