Skip to content

Instantly share code, notes, and snippets.

@vigoo
Created November 22, 2019 16:48
Show Gist options
  • Save vigoo/b810d76dfe166323bd8421a77c403c42 to your computer and use it in GitHub Desktop.
Save vigoo/b810d76dfe166323bd8421a77c403c42 to your computer and use it in GitHub Desktop.
prox 2/14
val customPipe: Pipe[IO, Byte, Byte] =
(s: Stream[IO, Byte]) => s
.through(text.utf8Decode)
.through(text.lines)
.map(_.split(' ').toVector)
.map(v => v.map(_ + " !!!").mkString(" "))
.intersperse("\n")
.through(text.utf8Encode)
val proc = Process("echo", List("This is a test string"))
.via(customPipe)
.to(Process("wc", List("-w")) > text.utf8Decode[IO])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment