I have a scalaz-stream process:
val src = Process.repeatEval(Task(in.take())) : Process[Task, Option[T]]
How do I get rid of Option?
So far I've used collect but it doesn't feel elegant:
src.collect { case Some(x) => x } : Process[Task, T]
Is there a better way?
Your solution is correct, but the implementation is already present in scalaz-stream (<= 0.8), in
process1.stripNone:or
Many other transformations (possibly stateful) are defined in
process1, so it's worth looking through the file for possibly useful transformations.