Filtering and removing duplicates #
List.dedup keeps the last copy of each entry. Filtering commutes with it, as lists and not only
as sets: the copies that dedup removes are equal to the copy it keeps, so a filter keeps or
removes all of them together.
Main results #
List.dedup_filter: removing duplicates after filtering is filtering after removing duplicates.