I was converting some code from Futures, and found that I couldn't directly translate for { (foo, bar) <- IO(blah) } due to the lack of withFilter
withFilter is reportedly unsafe. You might find this discussion interesting: https://github.com/scalaz/scalaz/pull/728
I'm on the fence about adding it and I'm leaning towards NO 馃憥 , because the need for it is an artifact of how the current Scala compiler works and might not survive long term, plus you can live just fine without it:
for {
r <- IO(blah)
(foo, bar) = r
} yield ???
I did use that fix for the record; my desire to have this is purely because it makes the transition to using IO more smooth for people with less experience. On the surface, using (foo, bar) <- IO(blah) getting a compile error about IO not having withFilter is one I expect to be confusing to newcomers.
Worst case I could always add an implicit to my codebase
Reading the Maybe discussion was fairly enlightening, thanks
Most helpful comment
I did use that fix for the record; my desire to have this is purely because it makes the transition to using IO more smooth for people with less experience. On the surface, using
(foo, bar) <- IO(blah)getting a compile error about IO not having withFilter is one I expect to be confusing to newcomers.Worst case I could always add an implicit to my codebase