Skip to content

Instantly share code, notes, and snippets.

@fiadliel
Created October 3, 2016 10:56
Show Gist options
  • Save fiadliel/d2e1bad798d1d312e83671cfc8b71497 to your computer and use it in GitHub Desktop.
Save fiadliel/d2e1bad798d1d312e83671cfc8b71497 to your computer and use it in GitHub Desktop.
import fs2._
def pipeR[F, A, B, C](pipe: Pipe[F, B, C]): Pipe[F, (A, B), (A, C)] = {
s =>
s.map(_._1).zip(s.map(_._2).through(pipe))
}
def pipeL[F, A, B, C](pipe: Pipe[F, A, C]): Pipe[F, (A, B), (C, B) = {
s =>
s.map(_._1).through(pipe).zip(s.map(_._2))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment