1. (Originally Unix, now also MS-DOS) A program that processes an input data stream into an output data stream in some well-defined way, and does no I/O to anywhere else except possibly on error conditions; one designed to be used as a stage in a pipeline (see plumbing). Compare sponge.
filter p  =  filter p (x:xs) = if p x then x : rest else rest where rest = filter p xs
See also filter promotion.