I mean that kinda makes sense... I dunno what on earth `try`ing a Future means!
-
-
Replying to @Gankra_ @JakeGoulding
And that's the part that makes it more generic and useful
1 reply 0 retweets 0 likes -
Replying to @sgrif @JakeGoulding
or it points to merging Future with Option/Result being completely muddied and problematic!
6 replies 0 retweets 1 like -
Replying to @Gankra_ @JakeGoulding
So why is the first better than the second? https://gist.github.com/sgrif/f967116241999765e3f46506215ad8ae …
1 reply 0 retweets 0 likes -
Replying to @sgrif @JakeGoulding
also objectively this is the best x.flatMap { (y) in do_stuff(y) .flatMap { do_more_stuff(y, $0) }}
3 replies 0 retweets 0 likes -
In seriousness, do notation kinda sucks since it can't appear in expression position.
2 replies 0 retweets 0 likes -
Replying to @jckarter @JakeGoulding
Theoretical Rust do notation totally would though
2 replies 0 retweets 0 likes -
Replying to @sgrif @JakeGoulding
e.g. match thing { Ok(x) => x; Err(error) => return Err(error) }
1 reply 0 retweets 0 likes -
Replying to @jckarter @JakeGoulding
Yes, that's exactly what `try!` does (with an `into` call on the error in case there's conversion)
1 reply 0 retweets 0 likes -
Replying to @sgrif @JakeGoulding
Yeah, thinking about it I guess you don't have enough primitive inversion of control to do that for a future.
1 reply 0 retweets 0 likes
Exactly. Can only be represented by nesting in `and_then` which is what do notation would do
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.