List.filter is an F# library function that retains the elements of a list that satisfy a predicate function. It belongs to the List module, which provides common operations for processing lists. section 7.2.3 section 7.2.4
Use filtering when a list must be reduced to matching items rather than transformed into a different shape. Call the function through the List module, and read its signature before combining it with other collection functions. section 7.2.3 section 7.2.4
Practical habits make List.filter easier to use:
- Treat filter as one operation in a larger collection-processing pipeline. section 7.2.4
- Inspect function signatures instead of randomly plugging collection functions together. section 7.2.3
- Practice related operations such as map, collect, groupBy, partition, skip, and take until their combinations become familiar. section 7.2.4
