On 2014-04-24 13:10, Matthew Pocock wrote:
> HI,
>
> So I've had a read through some of the docs, but I'm left not quite
> sure what problem extended for comprehension syntax solves.
It makes complex queries with operations like sortBy and groupBy (that
act on the whole collection at some point in the query) more readable.
The example in the document is a leftover from my Comprehensive
Comprehensions proposal and maybe not the best one for the new approach.
> The rather ugly for-comprehensions in the examples look a lot like the
> sort of ugly nesting that the async/await macro does away with when
> working with futures. Perhaps I'm just not understanding.
async/await does a cps transform to put imperative code into a monadic
context (I think it's still limited to Future at the moment). It doesn't
deal with computations on the monadic values, only with computations on
the elements, so it's orthogonal to this.