Thinking about it, if the exclusion list `f` is any size at all, then a Set should be used instead of an Array.  A set will use a hash lookup instead of a linear lookup, which will be faster.