3 ms·
A useful utility I've rarely seen included in such a list is inverse_image(collection, function) which computes the inverse image of the function restricted to
by yummyfajitas 17y ago
A useful utility I've rarely seen included in such a list is inverse_image(collection, function) which computes the inverse image of the function restricted to the collection.
A simple example:
students_by_grade = inverse_image(students, lambda s: s.grade)
Then students_by_gender["A"] contains a list of all the A students (and so on).
- jongraehl 17y agoAgreed - sometimes known as "group by".