knutwalker / transducers-scala

Transducers are a way to build reusable transformations.
Apache License 2.0
66 stars 1 forks source link

Support for parallel composition with a function like "zip" #2

Open nikita-volkov opened 7 years ago

nikita-volkov commented 7 years ago

Here's what I suggest:

  val transducer1: Transducer[Int, String] =
    map(_.toString)

  val transducer2: Transducer[Int, Double] =
    map(_.toDouble)

  val transducer3: Transducer[Int, (String, Double)] =
    ??? // should be achievable with something like transducer1.zip(transducer2)
knutwalker commented 7 years ago

Hi, thanks for the request. I thinks it's a good idea, let me have a look at how to implement it.

nikita-volkov commented 7 years ago

I've been experimenting with this in my own implementation of transducers. Unfortunately it seems impossible to implement. I might have been approaching it from a wrong end though, so it's still worth for you to try on your own.