move type system codes from domain.ml to type.ml