3 ms·
I think, an explicit type would make it even easier to grok: ISet<Author> authorsOfLongBooks = books .filter(book => book.pageCount > 1000) .map(
by Archelaos 2y ago
I think, an explicit type would make it even easier to grok:
ISet<Author> authorsOfLongBooks =
books
.filter(book => book.pageCount > 1000)
.map(book => book.author)
.distinct()
.toHashset()
Or whatever the equivalent for ISet<Author> is in the respective language. Or IReadonlySet<Author> if the set should be immutable.