array_filter: make the .hhi files work with custom return type.

Summary: This is merging work from D1447846 and D1567517. It was originally set up in a way that ignored .hhi definitions, but I do want to use them for argument typechecking, I just want to overwrite the return type with something custom.

Reviewed By: @dlreeves

Differential Revision: D1567598