Erlang ships with a few versions of filter in the lists module, along with variants such as mapfoldl that allow you to combine a map and foldl operation into a single pass.

For the best efficiency in your programs, you should review the existing functionality in the lists module to see if there are any combined functions that could reduce the amount of list traversal in your application.