Commit efdb5ba1 authored by John van Groningen's avatar John van Groningen
Browse files

refactor, remove unused IdentPos in argument of function tryToSolveOverloading

parent 54b93c86
...@@ -42,7 +42,7 @@ from check_instances import ::SortedInstances ...@@ -42,7 +42,7 @@ from check_instances import ::SortedInstances
:: LocalTypePatternVariable :: LocalTypePatternVariable
:: DictionaryTypes :== [(Index, [ExprInfoPtr])] :: DictionaryTypes :== [(Index, [ExprInfoPtr])]
tryToSolveOverloading :: ![(Optional [TypeContext], [ExprInfoPtr], IdentPos, Index)] !Int !{# CommonDefs } !ClassInstanceInfo !*Coercions !*OverloadingState tryToSolveOverloading :: ![(Optional [TypeContext], [ExprInfoPtr], Index)] !Int !{# CommonDefs } !ClassInstanceInfo !*Coercions !*OverloadingState
-> (![TypeContext], !*Coercions, ![LocalTypePatternVariable], DictionaryTypes, !*OverloadingState) -> (![TypeContext], !*Coercions, ![LocalTypePatternVariable], DictionaryTypes, !*OverloadingState)
:: TypeCodeInfo = :: TypeCodeInfo =
......
...@@ -1306,7 +1306,7 @@ where ...@@ -1306,7 +1306,7 @@ where
specialized_types_in_context_match _ _ type_var_heap specialized_types_in_context_match _ _ type_var_heap
= (False,type_var_heap); = (False,type_var_heap);
tryToSolveOverloading :: ![(Optional [TypeContext], [ExprInfoPtr], IdentPos, Index)] !Int !{# CommonDefs } !ClassInstanceInfo !*Coercions !*OverloadingState tryToSolveOverloading :: ![(Optional [TypeContext], [ExprInfoPtr], Index)] !Int !{# CommonDefs } !ClassInstanceInfo !*Coercions !*OverloadingState
-> (![TypeContext], !*Coercions, ![LocalTypePatternVariable], DictionaryTypes, !*OverloadingState) -> (![TypeContext], !*Coercions, ![LocalTypePatternVariable], DictionaryTypes, !*OverloadingState)
tryToSolveOverloading ocs main_dcl_module_n defs instance_info coercion_env os tryToSolveOverloading ocs main_dcl_module_n defs instance_info coercion_env os
# (reduced_calls, contexts, coercion_env, type_pattern_vars, os) = foldSt (reduce_contexts_of_applications_in_function defs instance_info) ocs ([], [], coercion_env, [], os) # (reduced_calls, contexts, coercion_env, type_pattern_vars, os) = foldSt (reduce_contexts_of_applications_in_function defs instance_info) ocs ([], [], coercion_env, [], os)
...@@ -1319,10 +1319,10 @@ tryToSolveOverloading ocs main_dcl_module_n defs instance_info coercion_env os ...@@ -1319,10 +1319,10 @@ tryToSolveOverloading ocs main_dcl_module_n defs instance_info coercion_env os
= (contexts, coercion_env, type_pattern_vars, dict_types, {os & os_type_heaps = hp_type_heaps, os_symbol_heap = hp_expression_heap, os_var_heap = hp_var_heap, os_generic_heap = hp_generic_heap, os_error = os_error}) = (contexts, coercion_env, type_pattern_vars, dict_types, {os & os_type_heaps = hp_type_heaps, os_symbol_heap = hp_expression_heap, os_var_heap = hp_var_heap, os_generic_heap = hp_generic_heap, os_error = os_error})
= ([], coercion_env, type_pattern_vars, [], os) = ([], coercion_env, type_pattern_vars, [], os)
where where
reduce_contexts_of_applications_in_function :: {#CommonDefs} ClassInstanceInfo (.a, [ExprInfoPtr], .b, Index) reduce_contexts_of_applications_in_function :: {#CommonDefs} ClassInstanceInfo (.a, [ExprInfoPtr], Index)
([(SymbIdent,Index,ExprInfoPtr,[ClassApplication])], ![TypeContext], !*Coercions, ![LocalTypePatternVariable], !*OverloadingState) ([(SymbIdent,Index,ExprInfoPtr,[ClassApplication])], ![TypeContext], !*Coercions, ![LocalTypePatternVariable], !*OverloadingState)
-> ([(SymbIdent,Index,ExprInfoPtr,[ClassApplication])], ![TypeContext], !*Coercions, ![LocalTypePatternVariable], !*OverloadingState) -> ([(SymbIdent,Index,ExprInfoPtr,[ClassApplication])], ![TypeContext], !*Coercions, ![LocalTypePatternVariable], !*OverloadingState)
reduce_contexts_of_applications_in_function defs instance_info (opt_spec_contexts, expr_ptrs, pos, index) state reduce_contexts_of_applications_in_function defs instance_info (opt_spec_contexts, expr_ptrs, index) state
= foldSt (reduce_contexts_of_application index defs instance_info) expr_ptrs state = foldSt (reduce_contexts_of_application index defs instance_info) expr_ptrs state
reduce_contexts_of_application :: !Index !{#CommonDefs} !ClassInstanceInfo !ExprInfoPtr reduce_contexts_of_application :: !Index !{#CommonDefs} !ClassInstanceInfo !ExprInfoPtr
...@@ -1430,9 +1430,9 @@ where ...@@ -1430,9 +1430,9 @@ where
add_contexts_of_constructor [] new_contexts predef_symbols var_heap add_contexts_of_constructor [] new_contexts predef_symbols var_heap
= (new_contexts,[],predef_symbols,var_heap) = (new_contexts,[],predef_symbols,var_heap)
add_specified_contexts (Yes spec_context, expr_ptrs, pos, index) (contexts,var_heap) add_specified_contexts (Yes spec_context, expr_ptrs, index) (contexts,var_heap)
= add_contexts spec_context contexts var_heap = add_contexts spec_context contexts var_heap
add_specified_contexts (No, expr_ptrs, pos, index) (contexts,var_heap) add_specified_contexts (No, expr_ptrs, index) (contexts,var_heap)
= (contexts,var_heap) = (contexts,var_heap)
add_contexts contexts all_contexts var_heap add_contexts contexts all_contexts var_heap
......
...@@ -3181,11 +3181,11 @@ where ...@@ -3181,11 +3181,11 @@ where
collect_and_expand_overloaded_calls [{fe_context=Yes context, fe_requirements={req_overloaded_calls,req_case_and_let_exprs}, fe_location, fe_index}:reqs] calls (subst, expr_heap) collect_and_expand_overloaded_calls [{fe_context=Yes context, fe_requirements={req_overloaded_calls,req_case_and_let_exprs}, fe_location, fe_index}:reqs] calls (subst, expr_heap)
# (_, context, subst) = arraySubst context subst # (_, context, subst) = arraySubst context subst
subst_expr_heap = expand_case_or_let_types req_case_and_let_exprs (subst, expr_heap) subst_expr_heap = expand_case_or_let_types req_case_and_let_exprs (subst, expr_heap)
= collect_and_expand_overloaded_calls reqs [(Yes context, req_overloaded_calls, fe_location, fe_index) : calls] = collect_and_expand_overloaded_calls reqs [(Yes context, req_overloaded_calls, fe_index) : calls]
(foldSt expand_type_contexts req_overloaded_calls subst_expr_heap) (foldSt expand_type_contexts req_overloaded_calls subst_expr_heap)
collect_and_expand_overloaded_calls [{fe_context, fe_requirements={req_overloaded_calls,req_case_and_let_exprs}, fe_location, fe_index}:reqs] calls subst_expr_heap collect_and_expand_overloaded_calls [{fe_context, fe_requirements={req_overloaded_calls,req_case_and_let_exprs}, fe_location, fe_index}:reqs] calls subst_expr_heap
# subst_expr_heap = expand_case_or_let_types req_case_and_let_exprs subst_expr_heap # subst_expr_heap = expand_case_or_let_types req_case_and_let_exprs subst_expr_heap
= collect_and_expand_overloaded_calls reqs [(fe_context, req_overloaded_calls, fe_location, fe_index) : calls] = collect_and_expand_overloaded_calls reqs [(fe_context, req_overloaded_calls, fe_index) : calls]
(foldSt expand_type_contexts req_overloaded_calls subst_expr_heap) (foldSt expand_type_contexts req_overloaded_calls subst_expr_heap)
expand_type_contexts over_info_ptr (subst, expr_heap) expand_type_contexts over_info_ptr (subst, expr_heap)
...@@ -3301,8 +3301,7 @@ where ...@@ -3301,8 +3301,7 @@ where
ts_var_heap = makeBase fun_ident tb_args temp_fun_type.tst_args ts_var_heap ts_var_heap = makeBase fun_ident tb_args temp_fun_type.tst_args ts_var_heap
fe_location = newPosition fun_ident fun_pos fe_location = newPosition fun_ident fun_pos
ts_error = setErrorPosition fun_ident fun_pos ts_error ts_error = setErrorPosition fun_ident fun_pos ts_error
// ts = { ts & ts_var_heap = ts_var_heap, ts_error = ts_error} ts & ts_var_heap = ts_var_heap, ts_error = ts_error, ts_fun_defs = ts_fun_defs, ts_fun_env = ts_fun_env
ts = { ts & ts_var_heap = ts_var_heap, ts_error = ts_error, ts_fun_defs = ts_fun_defs, ts_fun_env = ts_fun_env}
reqs = { req_overloaded_calls = [], req_type_coercion_groups = [], req_type_coercions = [], reqs = { req_overloaded_calls = [], req_type_coercion_groups = [], req_type_coercions = [],
req_attr_coercions = [], req_case_and_let_exprs = [] } req_attr_coercions = [], req_case_and_let_exprs = [] }
(rhs_type, rhs_expr_ptr, (rhs_reqs, ts)) = requirements ti tb_rhs (reqs, ts) (rhs_type, rhs_expr_ptr, (rhs_reqs, ts)) = requirements ti tb_rhs (reqs, ts)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment