type system implementation