Skip to content

Instantly share code, notes, and snippets.

@avakhrenev
avakhrenev / runConcat.scala
Last active January 22, 2019 14:35
fs2 runConcat. Evaluate two streams asynchronously, concating result.
import cats.effect.{Effect, IO}
import fs2._
import scala.concurrent.ExecutionContext
def runConcat[F[_], A](first: Stream[F, A], second: Stream[F, A])(
implicit F: Effect[F],
ec: ExecutionContext): Stream[F, A] = {
type Step = AsyncPull[F, Option[(Segment[A, Unit], Stream[F, A])]]
def readFull(s: Step): Pull[F, A, Unit] =
@avakhrenev
avakhrenev / about.md
Last active August 29, 2015 14:13 — forked from jasonrudolph/about.md