Add a function based validator.