diff --git a/compiler/add_pragma_decl.m b/compiler/add_pragma_decl.m index 771e8ec84..9ac34036e 100644 --- a/compiler/add_pragma_decl.m +++ b/compiler/add_pragma_decl.m @@ -624,11 +624,6 @@ check_input_spec_type(TypeTable, Type, Type = higher_order_type(_PorF, ArgTypes, _HOInstInfo, _Purity), check_input_spec_types(TypeTable, ArgTypes, !UnknownTypeCtors, !NonDuTypeCtors, !TVarBag) - ; - Type = apply_n_type(TVar, ArgTypes, _Kind), - bag.insert(TVar, !TVarBag), - check_input_spec_types(TypeTable, ArgTypes, - !UnknownTypeCtors, !NonDuTypeCtors, !TVarBag) ; Type = kinded_type(SubType, _Kind), check_input_spec_type(TypeTable, SubType, diff --git a/compiler/add_pred.m b/compiler/add_pred.m index 3db8982f4..23347dd3d 100644 --- a/compiler/add_pred.m +++ b/compiler/add_pred.m @@ -578,9 +578,6 @@ report_any_unqualified_type(PredSymName, Context, Type, !Specs) :- ; Type = higher_order_type(_PorF, ArgTypes, _HOInstInfo, _Purity), report_any_unqualified_types(PredSymName, Context, ArgTypes, !Specs) - ; - Type = apply_n_type(_TVar, ArgTypes, _Kind), - report_any_unqualified_types(PredSymName, Context, ArgTypes, !Specs) ; Type = kinded_type(SubType, _Kind), report_any_unqualified_type(PredSymName, Context, SubType, !Specs) diff --git a/compiler/add_type.m b/compiler/add_type.m index 2a57f2bc0..7143026a2 100644 --- a/compiler/add_type.m +++ b/compiler/add_type.m @@ -1923,9 +1923,6 @@ check_is_subtype(TypeTable, TVarSet0, OrigTypeStatus, ExistQVarsMapping, check_is_subtype_higher_order(TypeTable, TVarSet0, OrigTypeStatus, ExistQVarsMapping, ArgTypesA, ArgTypesB, MaybeArgModesA, MaybeArgModesB) - ; - TypeA = apply_n_type(_, _, _), - fail ; TypeA = kinded_type(TypeA1, Kind), TypeB = kinded_type(TypeB1, Kind), diff --git a/compiler/check_typeclass.m b/compiler/check_typeclass.m index 102101b96..af3858137 100644 --- a/compiler/check_typeclass.m +++ b/compiler/check_typeclass.m @@ -523,7 +523,6 @@ is_orig_type_non_eqv_type(ModuleInfo, ClassId, InstanceDefn, Type, ; ( Type = builtin_type(_) ; Type = higher_order_type(_, _, _, _) - ; Type = apply_n_type(_, _, _) ; Type = type_variable(_, _) ; Type = tuple_type(_, _) ) @@ -550,10 +549,6 @@ is_valid_instance_type(ModuleInfo, ClassId, InstanceDefn, Type, Type = higher_order_type(_, _, _, _), KindPieces = [words("is a")] ++ color_as_incorrect([words("higher order type;")]) - ; - Type = apply_n_type(_, _, _), - KindPieces = [words("is an")] ++ - color_as_incorrect([words("apply/N type;")]) ; Type = type_variable(_, _), KindPieces = [words("is a")] ++ @@ -611,7 +606,6 @@ find_non_type_variables([ArgType | ArgTypes], ArgNum, NonTVarArgs) :- ; ArgType = builtin_type(_) ; ArgType = higher_order_type(_, _, _, _) ; ArgType = tuple_type(_, _) - ; ArgType = apply_n_type(_, _, _) ; ArgType = kinded_type(_, _) ), NonTVarArgs = [ArgNum - ArgType | TailNonTVarArgs] @@ -728,7 +722,6 @@ acc_type_ctors_in_type(Type, !TypeCtorSet) :- ; ( Type = tuple_type(ArgTypes, _Kind) ; Type = higher_order_type(_, ArgTypes, _, _) - ; Type = apply_n_type(_, ArgTypes, _) ), list.foldl(acc_type_ctors_in_type, ArgTypes, !TypeCtorSet) ; diff --git a/compiler/common.m b/compiler/common.m index 9b38ff848..283daba66 100644 --- a/compiler/common.m +++ b/compiler/common.m @@ -1524,10 +1524,6 @@ types_match_exactly(TypeA, TypeB) :- TypeA = tuple_type(ArgTypesA, _), TypeB = tuple_type(ArgTypesB, _), types_match_exactly_list(ArgTypesA, ArgTypesB) - ; - TypeA = apply_n_type(TVar, ArgTypesA, _), - TypeB = apply_n_type(TVar, ArgTypesB, _), - types_match_exactly_list(ArgTypesA, ArgTypesB) ; TypeA = kinded_type(_, _), unexpected($pred, "kind annotation") diff --git a/compiler/comp_unit_interface.m b/compiler/comp_unit_interface.m index 2da9cfcad..212e9200b 100644 --- a/compiler/comp_unit_interface.m +++ b/compiler/comp_unit_interface.m @@ -1949,7 +1949,6 @@ ctor_arg_is_dummy_type(TypeDefnMap, TVarSet, Type, CoveredTypes0) ; Type = builtin_type(_) ; Type = tuple_type(_, _) ; Type = higher_order_type(_, _, _, _) - ; Type = apply_n_type(_, _, _) ), IsDummyType = no ; @@ -3467,7 +3466,6 @@ accumulate_modules_in_type(Type, !MaybeUnqual, !ModuleNames) :- accumulate_modules_in_types(ArgTypes, !MaybeUnqual, !ModuleNames) ; ( Type = tuple_type(ArgTypes, _Kind) - ; Type = apply_n_type(_TVar, ArgTypes, _Kind) ; Type = higher_order_type(_PorF, ArgTypes, _HO, _Purity) ), accumulate_modules_in_types(ArgTypes, !MaybeUnqual, !ModuleNames) @@ -3503,7 +3501,6 @@ accumulate_modules_in_qual_type(Type, !ModuleNames) :- accumulate_modules_in_qual_types(ArgTypes, !ModuleNames) ; ( Type = tuple_type(ArgTypes, _Kind) - ; Type = apply_n_type(_TVar, ArgTypes, _Kind) ; Type = higher_order_type(_PorF, ArgTypes, _HO, _Purity) ), % XXX ITEM_LIST accumulate modules from _HOInstInfo diff --git a/compiler/equiv_type.m b/compiler/equiv_type.m index d34cede0f..0d2c33cb4 100644 --- a/compiler/equiv_type.m +++ b/compiler/equiv_type.m @@ -403,18 +403,6 @@ replace_in_type_maybe_record_use(TypeEqvMap, MaybeRecord, Changed = unchanged, Type = Type0 ) - ; - Type0 = apply_n_type(Var, ApplyArgTypes0, Kind), - replace_in_type_list_location_acc_circ(TypeEqvMap, MaybeRecord, - TypeCtorsAlreadyExpanded, ApplyArgTypes0, ApplyArgTypes, Changed, - set.init, Circ, !TVarSet, !ItemRecompDeps, !UsedModules), - ( - Changed = changed, - Type = apply_n_type(Var, ApplyArgTypes, Kind) - ; - Changed = unchanged, - Type = Type0 - ) ; Type0 = kinded_type(RawType0, Kind), replace_in_type_maybe_record_use(TypeEqvMap, MaybeRecord, diff --git a/compiler/equiv_type_hlds.m b/compiler/equiv_type_hlds.m index a047f4e0e..437aecd43 100644 --- a/compiler/equiv_type_hlds.m +++ b/compiler/equiv_type_hlds.m @@ -786,13 +786,6 @@ hlds_replace_in_type_2(TypeEqvMap, TypeCtorsAlreadyExpanded, ( Changed = unchanged, Type = Type0 ; Changed = changed, Type = tuple_type(Args, Kind) ) - ; - Type0 = apply_n_type(Var, Args0, Kind), - hlds_replace_in_type_list_2(TypeEqvMap, TypeCtorsAlreadyExpanded, - Args0, Args, unchanged, Changed, !TVarSet), - ( Changed = unchanged, Type = Type0 - ; Changed = changed, Type = apply_n_type(Var, Args, Kind) - ) ; Type0 = kinded_type(RawType0, Kind), hlds_replace_in_type_2(TypeEqvMap, TypeCtorsAlreadyExpanded, diff --git a/compiler/error_type_util.m b/compiler/error_type_util.m index 3c06a116c..1b275fc8c 100644 --- a/compiler/error_type_util.m +++ b/compiler/error_type_util.m @@ -142,15 +142,6 @@ type_pieces(TVarSet, InstVarSet, VarNamePrint, SuffixPieces, Type) = Pieces :- Const = "{}", NonConstL = [left_paren_maybe_nl_inc("{", lp_plain)], NonConstR = [maybe_nl_dec_right_paren("}", rp_plain)] - ; - Type = apply_n_type(TVar, ArgTypes, _), - % XXX None of the test cases cover the output we generate - % for apply_n_type, so I (zs) don't know whether this is ok. - TVarStr = mercury_var_to_string_vs(TVarSet, VarNamePrint, TVar), - Const = TVarStr, - NonConstL = [fixed(TVarStr), - left_paren_maybe_nl_inc("(", lp_suffix)], - NonConstR = [maybe_nl_dec_right_paren(")", rp_plain)] ), ( ArgTypes = [], diff --git a/compiler/export.m b/compiler/export.m index 9b5232124..2788eb165 100644 --- a/compiler/export.m +++ b/compiler/export.m @@ -873,7 +873,6 @@ convert_type_to_mercury(RvalStr, Type, TargetArgLoc, ConvertedRvalStr) :- ; Type = defined_type(_, _, _) ; Type = higher_order_type(_, _, _, _) ; Type = tuple_type(_, _) - ; Type = apply_n_type(_, _, _) ; Type = kinded_type(_, _) ), ConvertedRvalStr = RvalStr @@ -927,7 +926,6 @@ convert_type_from_mercury(SourceArgLoc, RvalStr, Type, ConvertedRvalStr) :- ; Type = defined_type(_, _, _) ; Type = higher_order_type(_, _, _, _) ; Type = tuple_type(_, _) - ; Type = apply_n_type(_, _, _) ; Type = kinded_type(_, _) ), ConvertedRvalStr = RvalStr diff --git a/compiler/foreign.m b/compiler/foreign.m index e41347522..ecb81622a 100644 --- a/compiler/foreign.m +++ b/compiler/foreign.m @@ -231,7 +231,6 @@ maybe_foreign_type_to_c_string(Type, MaybeForeignType) = String :- % types for high level code, with or without high level data? ( Type = defined_type(_, _, _) ; Type = higher_order_type(_, _, _, _) - ; Type = apply_n_type(_, _, _) ), String = "MR_Word" ; @@ -265,7 +264,6 @@ maybe_foreign_type_to_csharp_string(Type, MaybeForeignType) = String :- ( Type = tuple_type(_, _) ; Type = defined_type(_, _, _) ; Type = higher_order_type(_, _, _, _) - ; Type = apply_n_type(_, _, _) ; Type = type_variable(_, _) ; Type = kinded_type(_, _) ), @@ -288,7 +286,6 @@ maybe_foreign_type_to_java_string(Type, MaybeForeignType) = String :- ( Type = tuple_type(_, _) ; Type = defined_type(_, _, _) ; Type = higher_order_type(_, _, _, _) - ; Type = apply_n_type(_, _, _) ; Type = type_variable(_, _) ; Type = kinded_type(_, _) ), diff --git a/compiler/hhf.m b/compiler/hhf.m index 8c4d73a1b..3edda17fa 100644 --- a/compiler/hhf.m +++ b/compiler/hhf.m @@ -480,8 +480,6 @@ same_type_2(higher_order_type(PorF, ArgsA, HOInstInfo, Purity), same_type_list(ArgsA, ArgsB). same_type_2(tuple_type(ArgsA, _), tuple_type(ArgsB, _)) :- same_type_list(ArgsA, ArgsB). -same_type_2(apply_n_type(_, ArgsA, _), apply_n_type(_, ArgsB, _)) :- - same_type_list(ArgsA, ArgsB). :- pred same_type_list(list(mer_type)::in, list(mer_type)::in) is semidet. diff --git a/compiler/higher_order.make_specialized_preds.m b/compiler/higher_order.make_specialized_preds.m index 88ece4864..16b7100c7 100644 --- a/compiler/higher_order.make_specialized_preds.m +++ b/compiler/higher_order.make_specialized_preds.m @@ -895,7 +895,6 @@ update_type_info_locn(Var, ConstraintType, Index, Index + 1, !RttiVarMaps) :- ; ConstraintType = builtin_type(_) ; ConstraintType = tuple_type(_, _) ; ConstraintType = higher_order_type(_, _, _, _) - ; ConstraintType = apply_n_type(_, _, _) ; ConstraintType = kinded_type(_, _) ) ). diff --git a/compiler/hlds_call_tree.m b/compiler/hlds_call_tree.m index c94011cfc..09000c61f 100644 --- a/compiler/hlds_call_tree.m +++ b/compiler/hlds_call_tree.m @@ -1184,9 +1184,8 @@ acc_local_type_ctors_in_type(ModuleName, Type, !TypeCtorNameArities) :- acc_local_type_ctors_in_types(ModuleName, ArgTypes, !TypeCtorNameArities) ; - ( Type = apply_n_type(_, ArgTypes, _) + ( Type = tuple_type(ArgTypes, _) ; Type = higher_order_type(_, ArgTypes, _, _) - ; Type = tuple_type(ArgTypes, _) ), acc_local_type_ctors_in_types(ModuleName, ArgTypes, !TypeCtorNameArities) diff --git a/compiler/hlds_rtti.m b/compiler/hlds_rtti.m index 6fa17154c..ee9a7cc35 100644 --- a/compiler/hlds_rtti.m +++ b/compiler/hlds_rtti.m @@ -762,7 +762,6 @@ apply_substs_to_ti_map(TRenaming, TSubst, Subst, TVar, Locn, !Map) :- ; NewType = defined_type(_, _, _) ; NewType = tuple_type(_, _) ; NewType = higher_order_type(_, _, _, _) - ; NewType = apply_n_type(_, _, _) ; NewType = kinded_type(_, _) ) ). diff --git a/compiler/inst_mode_type_prop.m b/compiler/inst_mode_type_prop.m index 530e789ec..210f5dab3 100644 --- a/compiler/inst_mode_type_prop.m +++ b/compiler/inst_mode_type_prop.m @@ -724,7 +724,6 @@ propagate_type_into_bound_functor(Info, Context, Type, Inst0, Inst, ; ( Type = type_variable(_, _) ; Type = higher_order_type(_, _, _, _) - ; Type = apply_n_type(_, _, _) ), % Type variables have no info to propagate into an inst. % Higher order types may have some, but we have not traditionally diff --git a/compiler/ml_unify_gen_construct.m b/compiler/ml_unify_gen_construct.m index cb6be48d6..8a08868ca 100644 --- a/compiler/ml_unify_gen_construct.m +++ b/compiler/ml_unify_gen_construct.m @@ -775,7 +775,6 @@ ml_gen_box_or_unbox_const_rval_hld(ModuleInfo, Context, ArgType, FieldType, ; FieldType = builtin_type(_) ; FieldType = tuple_type(_, _) ; FieldType = higher_order_type(_, _, _, _) - ; FieldType = apply_n_type(_, _, _) ; FieldType = kinded_type(_, _) ), % Otherwise, fall back on ml_gen_box_or_unbox_rval in ml_call_gen.m. diff --git a/compiler/mlds_dump.m b/compiler/mlds_dump.m index 858686b96..94343c278 100644 --- a/compiler/mlds_dump.m +++ b/compiler/mlds_dump.m @@ -1225,18 +1225,6 @@ mercury_type_to_strcord(MerType) = Cord :- strcord(")") ), Cord = PurityCord ++ PorFCord ++ ArgCord - ; - MerType = apply_n_type(TypeVar, ArgTypes, _Kind), - ( - ArgTypes = [], - Cord = strcord("apply_tvar_") ++ intcord(var_to_int(TypeVar)) - ; - ArgTypes = [HeadArgType | TailArgTypes], - Cord = strcord("apply_tvar_") ++ intcord(var_to_int(TypeVar)) ++ - strcord("(") ++ - mercury_types_to_strcord(HeadArgType, TailArgTypes) ++ - strcord(")") - ) ; MerType = kinded_type(SubType, _Kind), Cord = mercury_type_to_strcord(SubType) diff --git a/compiler/mlds_to_c_data.m b/compiler/mlds_to_c_data.m index e342217aa..92b12507f 100644 --- a/compiler/mlds_to_c_data.m +++ b/compiler/mlds_to_c_data.m @@ -366,7 +366,6 @@ mlds_output_boxed_rval(Opts, Stream, Type, Rval, !IO) :- ( MercuryType = defined_type(_, _, _) ; MercuryType = tuple_type(_, _) ; MercuryType = higher_order_type(_, _, _, _) - ; MercuryType = apply_n_type(_, _, _) ; MercuryType = kinded_type(_, _) ), mlds_output_boxed_rval_default(Opts, Stream, Rval, !IO) @@ -569,7 +568,6 @@ mlds_output_unboxed_rval(Opts, Stream, Type, Rval, !IO) :- ; MercuryType = defined_type(_, _, _) ; MercuryType = tuple_type(_, _) ; MercuryType = higher_order_type(_, _, _, _) - ; MercuryType = apply_n_type(_, _, _) ; MercuryType = kinded_type(_, _) ), mlds_output_unboxed_rval_default(Opts, Stream, Type, Rval, !IO) diff --git a/compiler/mlds_to_cs_type.m b/compiler/mlds_to_cs_type.m index 14e4643cd..59b848085 100644 --- a/compiler/mlds_to_cs_type.m +++ b/compiler/mlds_to_cs_type.m @@ -407,7 +407,6 @@ csharp_builtin_type(Type, TargetType) :- ( MerType = type_variable(_, _) ; MerType = tuple_type(_, _) ; MerType = higher_order_type(_, _, _, _) - ; MerType = apply_n_type(_, _, _) ; MerType = kinded_type(_, _) ), fail diff --git a/compiler/mlds_to_java_type.m b/compiler/mlds_to_java_type.m index 7f8e9ee84..cee6fd5c7 100644 --- a/compiler/mlds_to_java_type.m +++ b/compiler/mlds_to_java_type.m @@ -486,7 +486,6 @@ java_builtin_type(MLDS_Type, JavaUnboxedType, JavaBoxedType, UnboxMethod) :- ( MerType = type_variable(_, _) ; MerType = tuple_type(_, _) ; MerType = higher_order_type(_, _, _, _) - ; MerType = apply_n_type(_, _, _) ; MerType = kinded_type(_, _) ), fail diff --git a/compiler/modecheck_coerce.m b/compiler/modecheck_coerce.m index 73e391a71..b96c46f68 100644 --- a/compiler/modecheck_coerce.m +++ b/compiler/modecheck_coerce.m @@ -683,7 +683,6 @@ get_bound_functor_cons_and_arg_types(ModuleInfo, TypeX, TypeY, ; ( TypeX = type_variable(_, _) ; TypeX = higher_order_type(_, _, _, _) - ; TypeX = apply_n_type(_, _, _) ), Result = bad_cons_id_for_input_type ). @@ -1139,9 +1138,6 @@ types_compare_as_given_nonvar_mc(TypeTable, TVarSet, Comparison, % We do not allow subtyping in higher order argument types. corresponding_types_compare_as_given_mc(TypeTable, TVarSet, compare_equal, ArgTypesA, ArgTypesB) - ; - TypeA = apply_n_type(_, _, _), - sorry($pred, "apply_n_type") ; TypeA = kinded_type(TypeA1, Kind), TypeB = kinded_type(TypeB1, Kind), diff --git a/compiler/module_qual.qualify_items.m b/compiler/module_qual.qualify_items.m index 6fd8ada18..5b90e92e0 100644 --- a/compiler/module_qual.qualify_items.m +++ b/compiler/module_qual.qualify_items.m @@ -1212,11 +1212,6 @@ qualify_type(InInt, ErrorContext, Type0, Type, !Info) :- % XXX We could pass a more specific error context. qualify_type_list(InInt, ErrorContext, Args0, Args, !Info), Type = tuple_type(Args, Kind) - ; - Type0 = apply_n_type(Var, Args0, Kind), - % XXX We could pass a more specific error context. - qualify_type_list(InInt, ErrorContext, Args0, Args, !Info), - Type = apply_n_type(Var, Args, Kind) ; Type0 = kinded_type(SubType0, Kind), % XXX We could pass a more specific error context. diff --git a/compiler/old_type_constraints.m b/compiler/old_type_constraints.m index 8e1090fd6..a3152caf2 100644 --- a/compiler/old_type_constraints.m +++ b/compiler/old_type_constraints.m @@ -1514,11 +1514,6 @@ simple_find_domain(stconstr(TVarA, TypeA), !DomainMap) :- list.map(find_type_of_tvar(!.DomainMap), ArgTypes0, ArgTypes), NewTypeA = higher_order_type(PorF, ArgTypes, HOInstInfo, Purity), restrict_domain(TVarA, NewTypeA, !DomainMap) - ; - TypeA = apply_n_type(Return, ArgTypes0, Kind), - list.map(find_type_of_tvar(!.DomainMap), ArgTypes0, ArgTypes), - NewTypeA = apply_n_type(Return, ArgTypes, Kind), - restrict_domain(TVarA, NewTypeA, !DomainMap) ; TypeA = kinded_type(KindedTypeA, _), simple_find_domain(stconstr(TVarA, KindedTypeA), !DomainMap) @@ -1787,15 +1782,6 @@ unify_types(A, B, Type) :- else fail ) - ; - A = apply_n_type(TVarA, ArgsA, Kind), - B = apply_n_type(_, ArgsB, Kind), - ( if list.same_length(ArgsA, ArgsB) then - list.map_corresponding(unify_types, ArgsA, ArgsB, Args), - Type = apply_n_type(TVarA, Args, Kind) - else - fail - ) ; A = kinded_type(TypeA, Kind), B = kinded_type(TypeB, Kind), diff --git a/compiler/parse_tree_out_type.m b/compiler/parse_tree_out_type.m index bdd10e2fe..63dd8735b 100644 --- a/compiler/parse_tree_out_type.m +++ b/compiler/parse_tree_out_type.m @@ -236,10 +236,6 @@ type_to_debug_string(TVarSet, Type, Name) :- Name = "func(" ++ string.join_list(", ", ArgTypeNames) ++ ") = " ++ ReturnTypeName ) - ; - Type = apply_n_type(_, Subtypes, _), - list.map(type_to_debug_string(TVarSet), Subtypes, SubtypeNames), - Name = "func(" ++ string.join_list(", ", SubtypeNames) ++ ")" ; Type = kinded_type(Type0, _), type_to_debug_string(TVarSet, Type0, Name) diff --git a/compiler/parse_tree_to_term.m b/compiler/parse_tree_to_term.m index 06deb82bc..04fa36af6 100644 --- a/compiler/parse_tree_to_term.m +++ b/compiler/parse_tree_to_term.m @@ -121,12 +121,6 @@ unparse_type(Type, Term) :- Type = tuple_type(ArgTypes, _), unparse_type_list(ArgTypes, ArgTerms), Term = term.functor(term.atom("{}"), ArgTerms, Context) - ; - Type = apply_n_type(TVar, ArgTypes, _), - Var = term.coerce_var(TVar), - unparse_type_list(ArgTypes, ArgTerms), - Term = term.functor(term.atom(""), - [term.variable(Var, Context) | ArgTerms], Context) ; Type = kinded_type(_, _), unexpected($pred, "kind annotation") diff --git a/compiler/polymorphism_type_info.m b/compiler/polymorphism_type_info.m index 02e3ed780..310bcd93e 100644 --- a/compiler/polymorphism_type_info.m +++ b/compiler/polymorphism_type_info.m @@ -306,7 +306,6 @@ polymorphism_do_make_type_info_var(Type, Context, VarMCA, ExtraGoals, !Info) :- ; Type = builtin_type(_) ; Type = tuple_type(_, _) ; Type = higher_order_type(_,_, _, _) - ; Type = apply_n_type(_, _, _) ; Type = kinded_type(_, _) ), type_to_ctor_and_args_det(Type, TypeCtor, TypeArgs), diff --git a/compiler/pred_name.m b/compiler/pred_name.m index 6fc41e6f8..8c0eafba9 100644 --- a/compiler/pred_name.m +++ b/compiler/pred_name.m @@ -1887,7 +1887,6 @@ subst_to_mrtq_stuffed_string(TVar - Type) = Str :- % X = b: type is builtin type % X = d: type is defined type % X = t: type is tuple type - % X = a: type is apply_n type % X = h: type is higher order type % % X = n: end of name of type constructor @@ -1915,9 +1914,6 @@ type_to_txq_mrtq_stuffed_string(Type) = Str :- ; Type = tuple_type(ArgTypes, _), StartStr = "txq_t" - ; - Type = apply_n_type(TVar, ArgTypes, _), - string.format("txq_a_%d", [i(var_to_int(TVar))], StartStr) ; Type = higher_order_type(PorF, ArgTypes, _HOInst, Purity), ( PorF = pf_predicate, PorFStr = "p" diff --git a/compiler/prog_data.m b/compiler/prog_data.m index 6cfdb464b..5aeba4345 100644 --- a/compiler/prog_data.m +++ b/compiler/prog_data.m @@ -858,11 +858,6 @@ cons_id_is_const_struct(ConsId, ConstNum) :- purity ) - ; apply_n_type(tvar, list(mer_type), kind) - % An apply/N expression. `apply_n(V, [T1, ...], K)' - % would be the representation of type `V(T1, ...)' with kind K. - % The list must be non-empty. - ; kinded_type(mer_type, kind). % A type expression with an explicit kind annotation. % (These are not yet used.) @@ -873,7 +868,6 @@ cons_id_is_const_struct(ConsId, ConstNum) :- ; tuple_type(list(ground_type), kind) ; higher_order_type(pred_or_func, list(ground_type), ho_inst_info, purity) - ; apply_n_type(tvar, list(ground_type), kind) ; kinded_type(ground_type, kind). :- type var_or_ground_type @@ -889,7 +883,6 @@ cons_id_is_const_struct(ConsId, ConstNum) :- % ; tuple_type(list(mer_type), kind) % ; higher_order_type(pred_or_func, list(mer_type), ho_inst_info, % purity) -% ; apply_n_type(tvar, list(mer_type), kind) % ; kinded_type(mer_type, kind). % This type enumerates all of the builtin primitive types in Mercury. @@ -1133,7 +1126,6 @@ get_type_kind(defined_type(_, _, Kind)) = Kind. get_type_kind(builtin_type(_)) = kind_star. get_type_kind(higher_order_type(_, _, _, _)) = kind_star. get_type_kind(tuple_type(_, Kind)) = Kind. -get_type_kind(apply_n_type(_, _, Kind)) = Kind. get_type_kind(kinded_type(_, Kind)) = Kind. %---------------------------------------------------------------------------% diff --git a/compiler/prog_event.m b/compiler/prog_event.m index f07adf952..2beca9577 100644 --- a/compiler/prog_event.m +++ b/compiler/prog_event.m @@ -936,7 +936,6 @@ describe_attr_type(Type) = Desc :- ; ( Type = type_variable(_, _) ; Type = tuple_type(_, _) - ; Type = apply_n_type(_, _, _) ; Type = kinded_type(_, _) ), unexpected($pred, "type not constructed by prog_event") diff --git a/compiler/prog_rep_tables.m b/compiler/prog_rep_tables.m index c4546ccc5..d434b6ed2 100644 --- a/compiler/prog_rep_tables.m +++ b/compiler/prog_rep_tables.m @@ -394,9 +394,6 @@ add_type_to_table(Type, TypeCode, !StringTable, !TypeTable) :- Selector = 12 ), TypeBytesCord = cord.singleton(Selector) ++ ArgTypeBytesCord - ; - Type = apply_n_type(_TVar, _ArgTypes, _Kind), - unexpected($pred, "apply_n_type") ; Type = kinded_type(_Kind, _SubType), unexpected($pred, "kinded_type") diff --git a/compiler/prog_type.m b/compiler/prog_type.m index f18b8492d..71d39d5b7 100644 --- a/compiler/prog_type.m +++ b/compiler/prog_type.m @@ -277,9 +277,6 @@ type_to_ctor_and_args(Type, TypeCtor, ArgTypes) :- SymName = unqualified("{}"), Arity = list.length(ArgTypes), TypeCtor = type_ctor(SymName, Arity) - ; - Type = apply_n_type(_, _, _), - sorry($pred, "apply/N types") ; Type = kinded_type(SubType, _), type_to_ctor_and_args(SubType, TypeCtor, ArgTypes) @@ -348,11 +345,6 @@ strip_module_names_from_type(StripWhat, SetDefaultFunc, Type0, Type) :- strip_module_names_from_type_list(StripWhat, SetDefaultFunc, ArgTypes0, ArgTypes), Type = tuple_type(ArgTypes, Kind) - ; - Type0 = apply_n_type(Var, ArgTypes0, Kind), - strip_module_names_from_type_list(StripWhat, SetDefaultFunc, - ArgTypes0, ArgTypes), - Type = apply_n_type(Var, ArgTypes, Kind) ; Type0 = kinded_type(SubType0, Kind), strip_module_names_from_type(StripWhat, SetDefaultFunc, @@ -366,27 +358,27 @@ strip_module_names_from_type_list(StripWhat, SetDefaultFunc, Types0, Types) :- %---------------------------------------------------------------------------% -builtin_type_ctors_with_no_hlds_type_defn = +builtin_type_ctors_with_no_hlds_type_defn = [ % Every element of this list must be reflected in the code of % builtin_type_ctor in type_ctor_info.m. - [ type_ctor(qualified(mercury_public_builtin_module, "int"), 0), - type_ctor(qualified(mercury_public_builtin_module, "int8"), 0), - type_ctor(qualified(mercury_public_builtin_module, "int16"), 0), - type_ctor(qualified(mercury_public_builtin_module, "int32"), 0), - type_ctor(qualified(mercury_public_builtin_module, "int64"), 0), - type_ctor(qualified(mercury_public_builtin_module, "uint"), 0), - type_ctor(qualified(mercury_public_builtin_module, "uint8"), 0), - type_ctor(qualified(mercury_public_builtin_module, "uint16"), 0), - type_ctor(qualified(mercury_public_builtin_module, "uint32"), 0), - type_ctor(qualified(mercury_public_builtin_module, "uint64"), 0), - type_ctor(qualified(mercury_public_builtin_module, "string"), 0), - type_ctor(qualified(mercury_public_builtin_module, "character"), 0), - type_ctor(qualified(mercury_public_builtin_module, "float"), 0), - type_ctor(qualified(mercury_public_builtin_module, "pred"), 0), - type_ctor(qualified(mercury_public_builtin_module, "func"), 0), - type_ctor(qualified(mercury_public_builtin_module, "void"), 0), - type_ctor(qualified(mercury_public_builtin_module, "tuple"), 0) - ]. + type_ctor(qualified(mercury_public_builtin_module, "int"), 0), + type_ctor(qualified(mercury_public_builtin_module, "int8"), 0), + type_ctor(qualified(mercury_public_builtin_module, "int16"), 0), + type_ctor(qualified(mercury_public_builtin_module, "int32"), 0), + type_ctor(qualified(mercury_public_builtin_module, "int64"), 0), + type_ctor(qualified(mercury_public_builtin_module, "uint"), 0), + type_ctor(qualified(mercury_public_builtin_module, "uint8"), 0), + type_ctor(qualified(mercury_public_builtin_module, "uint16"), 0), + type_ctor(qualified(mercury_public_builtin_module, "uint32"), 0), + type_ctor(qualified(mercury_public_builtin_module, "uint64"), 0), + type_ctor(qualified(mercury_public_builtin_module, "string"), 0), + type_ctor(qualified(mercury_public_builtin_module, "character"), 0), + type_ctor(qualified(mercury_public_builtin_module, "float"), 0), + type_ctor(qualified(mercury_public_builtin_module, "pred"), 0), + type_ctor(qualified(mercury_public_builtin_module, "func"), 0), + type_ctor(qualified(mercury_public_builtin_module, "void"), 0), + type_ctor(qualified(mercury_public_builtin_module, "tuple"), 0) +]. %---------------------------------------------------------------------------% diff --git a/compiler/prog_type_scan.m b/compiler/prog_type_scan.m index c01c2bbf9..639f0b41e 100644 --- a/compiler/prog_type_scan.m +++ b/compiler/prog_type_scan.m @@ -107,10 +107,6 @@ type_vars_in_type_acc(Type, !RevTVars) :- ; Type = higher_order_type(_, ArgTypes, _, _) ), type_vars_in_types_acc(ArgTypes, !RevTVars) - ; - Type = apply_n_type(Var, ArgTypes, _), - !:RevTVars= [Var | !.RevTVars], - type_vars_in_types_acc(ArgTypes, !RevTVars) ; Type = kinded_type(SubType, _), type_vars_in_type_acc(SubType, !RevTVars) @@ -135,13 +131,6 @@ type_contains_var(Type, Var) :- ; Type = higher_order_type(_, ArgTypes, _, _) ), type_list_contains_var(ArgTypes, Var) - ; - Type = apply_n_type(V, ArgTypes, _), - ( - Var = V - ; - type_list_contains_var(ArgTypes, Var) - ) ; Type = kinded_type(SubType, _), type_contains_var(SubType, Var) diff --git a/compiler/prog_type_subst.m b/compiler/prog_type_subst.m index 53c7330ac..9d173c2fd 100644 --- a/compiler/prog_type_subst.m +++ b/compiler/prog_type_subst.m @@ -185,11 +185,6 @@ apply_renaming_to_type(Renaming, Type0, Type) :- Type0 = tuple_type(Args0, Kind), apply_renaming_to_types(Renaming, Args0, Args), Type = tuple_type(Args, Kind) - ; - Type0 = apply_n_type(TVar0, Args0, Kind), - apply_renaming_to_types(Renaming, Args0, Args), - apply_renaming_to_tvar(Renaming, TVar0, TVar), - Type = apply_n_type(TVar, Args, Kind) ; Type0 = kinded_type(BaseType0, Kind), apply_renaming_to_type(Renaming, BaseType0, BaseType), @@ -219,14 +214,6 @@ apply_subst_to_type(Subst, Type0, Type) :- Type0 = tuple_type(Args0, Kind), apply_subst_to_types(Subst, Args0, Args), Type = tuple_type(Args, Kind) - ; - Type0 = apply_n_type(TVar, Args0, Kind), - apply_subst_to_types(Subst, Args0, Args), - ( if map.search(Subst, TVar, AppliedType) then - apply_type_args(AppliedType, Args, Type) - else - Type = apply_n_type(TVar, Args, Kind) - ) ; Type0 = kinded_type(BaseType0, Kind), apply_subst_to_type(Subst, BaseType0, BaseType), @@ -257,15 +244,6 @@ apply_rec_subst_to_type(Subst, Type0, Type) :- Type0 = tuple_type(Args0, Kind), apply_rec_subst_to_types(Subst, Args0, Args), Type = tuple_type(Args, Kind) - ; - Type0 = apply_n_type(TVar, Args0, Kind), - apply_rec_subst_to_types(Subst, Args0, Args), - ( if map.search(Subst, TVar, AppliedType0) then - apply_rec_subst_to_type(Subst, AppliedType0, AppliedType), - apply_type_args(AppliedType, Args, Type) - else - Type = apply_n_type(TVar, Args, Kind) - ) ; Type0 = kinded_type(BaseType0, Kind), apply_rec_subst_to_type(Subst, BaseType0, BaseType), @@ -285,70 +263,6 @@ apply_rec_subst_to_types(Subst, Types0, Types) :- %---------------------------------------------------------------------------% -:- pred apply_type_args(mer_type::in, list(mer_type)::in, mer_type::out) - is det. - -apply_type_args(Type0, Args, Type) :- - ( - Type0 = type_variable(TVar, Kind0), - apply_type_args_to_kind(Kind0, Args, Kind), - Type = apply_n_type(TVar, Args, Kind) - ; - Type0 = defined_type(Name, Args0, Kind0), - apply_type_args_to_kind(Kind0, Args, Kind), - Type = defined_type(Name, Args0 ++ Args, Kind) - ; - ( Type0 = builtin_type(_) - ; Type0 = higher_order_type(_, _, _, _) - ), - ( - Args = [] - ; - Args = [_ | _], - unexpected($pred, "applied type args to builtin") - ), - Type = Type0 - ; - Type0 = tuple_type(Args0, Kind0), - apply_type_args_to_kind(Kind0, Args, Kind), - Type = tuple_type(Args0 ++ Args, Kind) - ; - Type0 = apply_n_type(TVar, Args0, Kind0), - apply_type_args_to_kind(Kind0, Args, Kind), - Type = apply_n_type(TVar, Args0 ++ Args, Kind) - ; - Type0 = kinded_type(BaseType0, _), - % We drop the explicit kind annotation, since: - % - it will already have been used by kind inference, and - % - it no longer corresponds to any explicit annotation given. - apply_type_args(BaseType0, Args, Type) - ). - -:- pred apply_type_args_to_kind(kind::in, list(mer_type)::in, kind::out) - is det. - -apply_type_args_to_kind(Kind0, ArgTypes, Kind) :- - ( - ArgTypes = [], - Kind = Kind0 - ; - ArgTypes = [HeadArgType | TailArgTypes], - ( - Kind0 = kind_star, - unexpected($pred, "too many args in apply_n") - ; - Kind0 = kind_arrow(KindA, KindB), - ( if get_type_kind(HeadArgType) = KindA then - apply_type_args_to_kind(KindB, TailArgTypes, Kind) - else - unexpected($pred, "kind error in apply_n") - ) - ; - Kind0 = kind_variable(_), - unexpected($pred, "unbound kind variable") - ) - ). - :- pred ensure_type_has_kind(kind::in, mer_type::in, mer_type::out) is det. ensure_type_has_kind(Kind, Type0, Type) :- diff --git a/compiler/prog_type_test.m b/compiler/prog_type_test.m index ca948d1da..315ac39cf 100644 --- a/compiler/prog_type_test.m +++ b/compiler/prog_type_test.m @@ -111,8 +111,7 @@ ; builtin_type(builtin_type) ; tuple_type(list(mer_type), kind) ; higher_order_type(pred_or_func, list(mer_type), ho_inst_info, - purity) - ; apply_n_type(tvar, list(mer_type), kind). + purity). % Remove the kind annotation at the top-level if there is one, % otherwise return the type unchanged. @@ -168,9 +167,7 @@ type_is_ground(Type) :- type_is_ground(Type, GroundType) :- require_complete_switch [Type] ( - ( Type = type_variable(_TVar, _) - ; Type = apply_n_type(_TVar, _, _) - ), + Type = type_variable(_TVar, _), fail ; Type = builtin_type(BuiltinType), @@ -279,7 +276,6 @@ strip_kind_annotation(Type0) = Type :- ; Type0 = builtin_type(_) ; Type0 = tuple_type(_, _) ; Type0 = higher_order_type(_, _, _, _) - ; Type0 = apply_n_type(_, _, _) ), Type = coerce(Type0) ). diff --git a/compiler/prog_type_unify.m b/compiler/prog_type_unify.m index 81a7fbc5e..7241b4d73 100644 --- a/compiler/prog_type_unify.m +++ b/compiler/prog_type_unify.m @@ -236,11 +236,7 @@ type_unify_nonvar(TypeX, TypeY, HeadTypeParams, !Bindings) :- tsubst::in, tsubst::out) is semidet. type_unify_special(TypeX, TypeY, HeadTypeParams, !Bindings) :- - ( if TypeX = apply_n_type(VarX, ArgTypesX, _) then - type_unify_apply(TypeY, VarX, ArgTypesX, HeadTypeParams, !Bindings) - else if TypeY = apply_n_type(VarY, ArgTypesY, _) then - type_unify_apply(TypeX, VarY, ArgTypesY, HeadTypeParams, !Bindings) - else if TypeX = kinded_type(RawX, _) then + ( if TypeX = kinded_type(RawX, _) then ( if TypeY = kinded_type(RawY, _) then type_unify(RawX, RawY, HeadTypeParams, !Bindings) else @@ -252,98 +248,6 @@ type_unify_special(TypeX, TypeY, HeadTypeParams, !Bindings) :- fail ). - % The idea here is that we try to strip off arguments from Y starting - % from the end and unify each with the corresponding argument of X. - % If we reach an atomic type before the arguments run out, we fail. - % If we reach a variable before the arguments run out, we unify it - % with what remains of the apply_n expression. If we manage to unify - % all of the arguments, we unify the apply_n variable with what remains - % of the other expression. - % - % Note that Y is not a variable, since that case would have been caught - % by type_unify. - % -:- pred type_unify_apply(mer_type::in, tvar::in, list(mer_type)::in, - list(tvar)::in, tsubst::in, tsubst::out) is semidet. - -type_unify_apply(TypeY, VarX, ArgTypesX0, HeadTypeParams, !Bindings) :- - ( - TypeY = defined_type(NameY, ArgTypesY0, KindY0), - type_unify_args(ArgTypesX0, ArgTypesY0, ArgTypesY, KindY0, KindY, - HeadTypeParams, !Bindings), - type_unify_var(VarX, defined_type(NameY, ArgTypesY, KindY), - HeadTypeParams, !Bindings) - ; - TypeY = builtin_type(_), - ArgTypesX0 = [], - type_unify_var(VarX, TypeY, HeadTypeParams, !Bindings) - ; - TypeY = higher_order_type(_, _, _, _), - ArgTypesX0 = [], - type_unify_var(VarX, TypeY, HeadTypeParams, !Bindings) - ; - TypeY = tuple_type(ArgTypesY0, KindY0), - type_unify_args(ArgTypesX0, ArgTypesY0, ArgTypesY, KindY0, KindY, - HeadTypeParams, !Bindings), - type_unify_var(VarX, tuple_type(ArgTypesY, KindY), HeadTypeParams, - !Bindings) - ; - TypeY = apply_n_type(VarY, ArgTypesY0, Kind0), - list.length(ArgTypesX0, NArgTypesX0), - list.length(ArgTypesY0, NArgTypesY0), - compare(Result, NArgTypesX0, NArgTypesY0), - ( - Result = (<), - type_unify_args(ArgTypesX0, ArgTypesY0, ArgTypesY, Kind0, Kind, - HeadTypeParams, !Bindings), - type_unify_var(VarX, apply_n_type(VarY, ArgTypesY, Kind), - HeadTypeParams, !Bindings) - ; - Result = (=), - % We know here that the list of remaining args will be empty. - type_unify_args(ArgTypesX0, ArgTypesY0, _, Kind0, Kind, - HeadTypeParams, !Bindings), - type_unify_var_var(VarX, VarY, Kind, HeadTypeParams, !Bindings) - ; - Result = (>), - type_unify_args(ArgTypesY0, ArgTypesX0, ArgTypesX, Kind0, Kind, - HeadTypeParams, !Bindings), - type_unify_var(VarY, apply_n_type(VarX, ArgTypesX, Kind), - HeadTypeParams, !Bindings) - ) - ; - TypeY = kinded_type(RawY, _), - type_unify_apply(RawY, VarX, ArgTypesX0, HeadTypeParams, !Bindings) - ; - TypeY = builtin_type(_), - % XXX I (zs) am not sure *why* it is ok to fail here. - fail - ). - -:- pred type_unify_args(list(mer_type)::in, list(mer_type)::in, - list(mer_type)::out, kind::in, kind::out, list(tvar)::in, - tsubst::in, tsubst::out) is semidet. - -type_unify_args(ArgTypesX, ArgTypesY0, ArgTypesY, - KindY0, KindY, HeadTypeParams, !Bindings) :- - list.reverse(ArgTypesX, RevArgTypesX), - list.reverse(ArgTypesY0, RevArgTypesY0), - type_unify_rev_args(RevArgTypesX, RevArgTypesY0, RevArgTypesY, - KindY0, KindY, HeadTypeParams, !Bindings), - list.reverse(RevArgTypesY, ArgTypesY). - -:- pred type_unify_rev_args(list(mer_type)::in, list(mer_type)::in, - list(mer_type)::out, kind::in, kind::out, list(tvar)::in, - tsubst::in, tsubst::out) is semidet. - -type_unify_rev_args([], ArgTypesY, ArgTypesY, KindY, KindY, _, !Bindings). -type_unify_rev_args([ArgTypeX | ArgTypesX], [ArgTypeY0 | ArgTypesY0], - ArgTypesY, KindY0, KindY, HeadTypeParams, !Bindings) :- - type_unify(ArgTypeX, ArgTypeY0, HeadTypeParams, !Bindings), - KindY1 = kind_arrow(get_type_kind(ArgTypeY0), KindY0), - type_unify_rev_args(ArgTypesX, ArgTypesY0, ArgTypesY, - KindY1, KindY, HeadTypeParams, !Bindings). - type_unify_list([], [], _HeadTypeParams, !Bindings). type_unify_list([X | Xs], [Y | Ys], HeadTypeParams, !Bindings) :- type_unify(X, Y, HeadTypeParams, !Bindings), @@ -374,16 +278,6 @@ type_occurs(TypeX, Y, Bindings) :- ; TypeX = tuple_type(ArgTypes, _), type_occurs_list(ArgTypes, Y, Bindings) - ; - TypeX = apply_n_type(X, ArgTypes, _), - ( - X = Y - ; - type_occurs_list(ArgTypes, Y, Bindings) - ; - map.search(Bindings, X, BindingOfX), - type_occurs(BindingOfX, Y, Bindings) - ) ; TypeX = kinded_type(TypeX1, _), type_occurs(TypeX1, Y, Bindings) diff --git a/compiler/pseudo_type_info.m b/compiler/pseudo_type_info.m index 5c7950bed..4a709570d 100644 --- a/compiler/pseudo_type_info.m +++ b/compiler/pseudo_type_info.m @@ -95,7 +95,6 @@ construct_pseudo_type_info(Type, NumUnivQTvars, ExistQTvars, PseudoTypeInfo) :- ; Type = builtin_type(_) ; Type = tuple_type(_, _) ; Type = higher_order_type(_, _, _, _) - ; Type = apply_n_type(_, _, _) ; Type = kinded_type(_, _) ), type_to_ctor_and_args_det(Type, TypeCtor, TypeArgs), diff --git a/compiler/typecheck_coerce.m b/compiler/typecheck_coerce.m index d20531fa4..67070f348 100644 --- a/compiler/typecheck_coerce.m +++ b/compiler/typecheck_coerce.m @@ -637,9 +637,6 @@ acc_invariant_tvars_in_ctor_arg_type(TypeTable, ActiveTypeCtors, type_vars_in_types(ArgTypes, TypeVars), list.foldl(one_or_more_map.reverse_add(CtorArgPosn), TypeVars, !InvariantTVars) - ; - CtorArgType = apply_n_type(_, _, _), - sorry($pred, "apply_n_type") ; CtorArgType = kinded_type(SubCtorArgType, _Kind), acc_invariant_tvars_in_ctor_arg_type(TypeTable, ActiveTypeCtors, @@ -813,9 +810,6 @@ types_compare_as_given(TypeTable, TVarSet, BaseTypeCtor, ArgNum, ; TypeB = type_variable(_, _), try_to_unify_types(TypeA, TypeB, !TypeAssign, !CoerceFails) - ; - TypeB = apply_n_type(_, _, _), - sorry($pred, "apply_n_type") ; ( TypeB = defined_type(_, _, _) ; TypeB = tuple_type(_, _) @@ -838,9 +832,6 @@ types_compare_as_given(TypeTable, TVarSet, BaseTypeCtor, ArgNum, ; TypeB = type_variable(_, _), try_to_unify_types(TypeA, TypeB, !TypeAssign, !CoerceFails) - ; - TypeB = apply_n_type(_, _, _), - sorry($pred, "apply_n_type") ; ( TypeB = builtin_type(_) ; TypeB = tuple_type(_, _) @@ -871,9 +862,6 @@ types_compare_as_given(TypeTable, TVarSet, BaseTypeCtor, ArgNum, ; TypeB = type_variable(_, _), try_to_unify_types(TypeA, TypeB, !TypeAssign, !CoerceFails) - ; - TypeB = apply_n_type(_, _, _), - sorry($pred, "apply_n_type") ; ( TypeB = builtin_type(_) ; TypeB = defined_type(_, _, _) @@ -908,9 +896,6 @@ types_compare_as_given(TypeTable, TVarSet, BaseTypeCtor, ArgNum, ; TypeB = type_variable(_, _), try_to_unify_types(TypeA, TypeB, !TypeAssign, !CoerceFails) - ; - TypeB = apply_n_type(_, _, _), - sorry($pred, "apply_n_type") ; ( TypeB = builtin_type(_) ; TypeB = defined_type(_, _, _) @@ -920,9 +905,6 @@ types_compare_as_given(TypeTable, TVarSet, BaseTypeCtor, ArgNum, CoerceFail = different_type_categories(TypeTable, TypeA, TypeB), !:CoerceFails = [CoerceFail | !.CoerceFails] ) - ; - TypeA = apply_n_type(_, _, _), - sorry($pred, "apply_n_type") ; TypeA = kinded_type(SubTypeA, KindA), ( @@ -945,9 +927,6 @@ types_compare_as_given(TypeTable, TVarSet, BaseTypeCtor, ArgNum, ; TypeB = type_variable(_, _), try_to_unify_types(TypeA, TypeB, !TypeAssign, !CoerceFails) - ; - TypeB = apply_n_type(_, _, _), - sorry($pred, "apply_n_type") ; ( TypeB = builtin_type(_) ; TypeB = defined_type(_, _, _) diff --git a/compiler/typecheck_error_builtin.m b/compiler/typecheck_error_builtin.m index 16cae9804..a8e4ac011 100644 --- a/compiler/typecheck_error_builtin.m +++ b/compiler/typecheck_error_builtin.m @@ -182,7 +182,6 @@ acc_builtin_type(Type, !BuiltinTypes) :- ; Type = defined_type(_, _, _) ; Type = tuple_type(_, _) ; Type = higher_order_type(_, _, _, _) - ; Type = apply_n_type(_, _, _) ) ; Type = kinded_type(SubType, _Kind), diff --git a/compiler/typecheck_error_diff.m b/compiler/typecheck_error_diff.m index e69e4b2b1..5175d2f40 100644 --- a/compiler/typecheck_error_diff.m +++ b/compiler/typecheck_error_diff.m @@ -138,13 +138,6 @@ generate_type_diff_pieces(ContextPieces, ExistQTVars, MaybeTopLevel, DiffPiecesPrime = arg_type_list_diff_pieces(ContextPieces, [words("the tuple type constructor")], ExistQTVars, ActualArgTypes, ExpectedArgTypes) - ; - ActualType = apply_n_type(TVar, ActualArgTypes, _), - ExpectedType = apply_n_type(TVar, ExpectedArgTypes, _), - ActualArgTypes \= ExpectedArgTypes, - DiffPiecesPrime = arg_type_list_diff_pieces(ContextPieces, - [words("apply_n type constructor")], - ExistQTVars, ActualArgTypes, ExpectedArgTypes) ; ActualType = higher_order_type(ActualPorF, ActualArgTypes, ActualInstInfo, ActualPurity), diff --git a/compiler/typecheck_error_util.m b/compiler/typecheck_error_util.m index 4079e9aa7..30eb27969 100644 --- a/compiler/typecheck_error_util.m +++ b/compiler/typecheck_error_util.m @@ -537,21 +537,6 @@ delete_identical_qualifications(TypeA0, TypeB0, TypeA, TypeB) :- TypeA = TypeA0, TypeB = TypeB0 ) - ; - TypeA0 = apply_n_type(TVar, ArgTypesA0, Kind), - ( if - TypeB0 = apply_n_type(TVar, ArgTypesB0, Kind), - maybe_from_corresponding_lists(ArgTypesA0, ArgTypesB0, - ArgTypesAB0) - then - delete_identical_qualifications_al(ArgTypesAB0, ArgTypesAB), - keys_and_values(ArgTypesAB, ArgTypesA, ArgTypesB), - TypeA = apply_n_type(TVar, ArgTypesA, Kind), - TypeB = apply_n_type(TVar, ArgTypesB, Kind) - else - TypeA = TypeA0, - TypeB = TypeB0 - ) ; TypeA0 = kinded_type(SubTypeA0, Kind), ( if TypeB0 = kinded_type(SubTypeB0, Kind) then diff --git a/compiler/typecheck_util.m b/compiler/typecheck_util.m index 34949dc7c..b5becb56b 100644 --- a/compiler/typecheck_util.m +++ b/compiler/typecheck_util.m @@ -262,9 +262,6 @@ classify_is_du_type(TypeTable, Type, MaybeDuType) :- DescStr = "impure " ++ PorFStr ), MaybeDuType = is_not_du_type(DescStr) - ; - Type = apply_n_type(_, _, _), - MaybeDuType = is_not_du_type("function type") ; Type = kinded_type(SubType, _), classify_is_du_type(TypeTable, SubType, MaybeDuType) diff --git a/compiler/unused_imports.m b/compiler/unused_imports.m index 1b996fb40..d37ba1046 100644 --- a/compiler/unused_imports.m +++ b/compiler/unused_imports.m @@ -1138,9 +1138,6 @@ mer_type_used_modules(Visibility, Type, !UsedModules) :- ; Type = tuple_type(ArgTypes, _), list.foldl(mer_type_used_modules(Visibility), ArgTypes, !UsedModules) - ; - Type = apply_n_type(_, ArgTypes, _), - list.foldl(mer_type_used_modules(Visibility), ArgTypes, !UsedModules) ; Type = kinded_type(ArgType, _), mer_type_used_modules(Visibility, ArgType, !UsedModules) diff --git a/compiler/unused_types.m b/compiler/unused_types.m index 614acc343..dcc3ca1c5 100644 --- a/compiler/unused_types.m +++ b/compiler/unused_types.m @@ -470,7 +470,6 @@ record_type_ctors_used_in_type(Type, !ShouldBeUsedTypeCtors) :- ; ( Type = tuple_type(ArgTypes, _Kind) ; Type = higher_order_type(_PorF, ArgTypes, _HOInstInfo, _Purity) - ; Type = apply_n_type(_TVar, ArgTypes, _Kind) ), record_type_ctors_used_in_types(ArgTypes, !ShouldBeUsedTypeCtors) ; diff --git a/compiler/xml_documentation.m b/compiler/xml_documentation.m index 3d0050f70..f8532abf8 100644 --- a/compiler/xml_documentation.m +++ b/compiler/xml_documentation.m @@ -527,7 +527,6 @@ mer_type_to_xml(TVarset, higher_order_type(PorF, Types, _, _)) = Xml :- mer_type_to_xml(TVarset, tuple_type(Types, _)) = Xml :- XmlArgs = xml_list("tuple_types", mer_type_to_xml(TVarset), Types), Xml = elem("tuple", [], [XmlArgs]). -mer_type_to_xml(_, apply_n_type(_, _, _)) = nyi("apply_n_type"). mer_type_to_xml(_, kinded_type(_, _)) = nyi("kinded_type"). %-----------------------------------------------------------------------------%