HN2new | past | comments | ask | show | jobs | submitlogin

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.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: