It would be better to also check that the function is unary.