Generic type checker for desired and given values