A filter function must never consume its arguments.

This just adds some more checks to the type checker.