Support filtering by arbitrary functions.