So you can't write, for { x <- Try(doSomething) x = someValue } yield x We can rewrite that as, for { x <- Try(doSomething) x <- Success(someValue) } yield x but it's a shame we need to.
-
-
Show this thread
-
If you need more convincing, spot the bug here: for { x <- Try(something) x2 <- someOperation(x) x3 <- andAnotherOne(x2) x4 <- somethingElse(x3) x5 <- methodApp(x3) x6 <- oneLastThing(x4) } yield x6 I know it was easy, but *only* because you were looking!
Show this thread
End of conversation
New conversation -
-
-
This Tweet is unavailable.
-
Oh, I would not usually call them "x". The scope is a bit too big for such an anonymous name...
End of conversation
-
-
-
Isn't the a good spot to kleisli?
-
Often, yes. Though I sometimes want to have other flatMaps between the ones which are operating on the "same" object.
End of conversation
New conversation -
-
-
This Tweet is unavailable.
-
It does, but it doesn't let you insert operations on different values in between.
- Show replies
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.