Recently when I started to use for-comprehensions with monadic structures like Task a lot, I’ve noticed that this is not a valid Scala syntax
def app: Task[Unit] =
for {
implicit foo <- createFoo
implicit bar = createBarWithImplicitFoo
_ <- runWithImplicitBar
} yield ()
How hard would it be to make this valid Scala code?
Desugared version should look like this (and it compiles just fine)
createFoo.flatMap { implicit foo =>
createBarWithImplicitFoo
}.flatMap { implicit bar =>
runWithImplicitBar
}