Created
April 1, 2015 20:00
-
-
Save lebek/ef5ec75addcb277d350c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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