nitc/typing: add intersect_types and diff_types