title: How do I "split" a stream in fs2?
body: <p>I want to do something like this:</p>
  
  <pre><code>def splitStream[F, A](stream: fs2.Stream[F, A], split: A =&gt; B): (Stream[F, A], Stream[F, B)) = 
    (stream, stream.map(split)
  </code></pre>
  
  <p>But this does not work as it "pulls" from the source twice - once each when I drain both <code>stream</code> and <code>stream.map(split)</code>. How do I prevent this? Somehow switch to a "push" based model by maintaining my own internal buffer so I don't pull twice?</p>