additional primitives for doing typechecking