Convenience method for invoking a function only if all validation was successful.