Delete the apply_n_type function symbol from mer_type. I have long known that many parts of the compiler threw an exception if they saw this function symbol. I assumed that this function symbol was used internally in the typechecker, but was always replaced by higher_order_type in its final result. However, while working on type coercions recently, I noticed that typechecker itself did not expect to see apply_n_types. I found that strange. In order to find out where apply_n_types are actually created, I commented out the apply_n_type function symbol in the definition mer_type and in its subtypes. What I found was that - the *only* predicate in the compiler that actually created an apply_n_type from scratch (as opposed to updating an existing apply_n_type by e.g. module-qualifying any of its argument types) was the predicate apply_type_args in prog_type_subst.m, but - the only two places where apply_type_args was called from were the predicates apply_subst_to_type and apply_rec_subst_to_type, and in both cases, they called apply_type_args only when they saw an existing apply_n_type value. In other words, the compiler could not ever create a type whose function symbol was apply_n_type. I think this has been true since 2005, when Mark replaced the original unstructured representation of types (as just terms) with something very close to the current structured representation. Mind you, in the term representation of types, the impossibility of ever creating the term equivalent of apply_n types would certainly have been even harder to see. compiler/prog_data.m: Delete the apply_n_type function symbol. compiler/*.m: Delete all the code that processed, transformed, ignored and/or threw an exception for apply_n_types. Delete the few predicates that have become unreachable as a result of the above deletions.