filterMap as a filter followed by a map #
l.filterMap f keeps the elements on which f is defined and maps them by f, read with any
default (List.filterMap_eq_map_filter). This is the form that list combinators which filter and
map separately compute.
Main results #
List.filterMap_eq_map_filter:l.filterMap fisl.filter (f · |>.isSome)mapped by(f · |>.getD d).List.getElem?_filterMap_of_forall_isSome,List.take_filterMap_of_forall_isSome: whenfis defined on every element,filterMap fpreserves positions, so it commutes with indexing and withtake.List.sum_map_filterMap_le: a sum over the values offilterMap fis at most a sum over the list that bounds every value.