Skip to content

Instantly share code, notes, and snippets.

@lebek
Created April 1, 2015 20:00
Show Gist options
  • Save lebek/ef5ec75addcb277d350c to your computer and use it in GitHub Desktop.
Save lebek/ef5ec75addcb277d350c to your computer and use it in GitHub Desktop.
import scalaz.stream._
import scalaz.concurrent.Task
object test {
val P = Process
def logger: Sink[Task,String] = io.stdOutLines
def one: Writer[Task, String, Int] = P.tell("Running one")
def two: Writer[Task, String, Int] = P.tell("Running two")
def process: Process[Task, Int] = one.flatMap(a => two).drainW(logger)
def task: Task[Unit] = {
process.run
}
def main(args: Array[String]) = {
task.run
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment