Commit 2a4edf2e authored by John van Groningen's avatar John van Groningen
Browse files

added code for OverloadedListPatterns

parent 4edac9f9
......@@ -756,6 +756,8 @@ instance e_corresponds CasePatterns where
e_corresponds (BasicPatterns dcl_basic_type dcl_patterns) (BasicPatterns icl_basic_type icl_patterns)
= equal2 dcl_basic_type icl_basic_type
o` e_corresponds dcl_patterns icl_patterns
e_corresponds (OverloadedListPatterns dcl_alg_type _ dcl_patterns) (OverloadedListPatterns icl_alg_type _ icl_patterns)
= e_corresponds dcl_patterns icl_patterns
e_corresponds (DynamicPatterns dcl_patterns) (DynamicPatterns icl_patterns)
= e_corresponds dcl_patterns icl_patterns
e_corresponds NoPattern NoPattern
......
......@@ -351,6 +351,10 @@ where
(BasicPatterns type basic_patterns)
# (basic_patterns, ci) = convertDynamics cinp bound_vars nested_case_default basic_patterns ci
-> (Case {keesje & case_expr = case_expr, case_guards = BasicPatterns type basic_patterns, case_default = this_case_default}, ci)
(OverloadedListPatterns type decons_expr algebraic_patterns)
# (algebraic_patterns, ci) = mapSt (convertDynamicsOfAlgebraicPattern cinp bound_vars nested_case_default)
(zip2 algebraic_patterns ct_cons_types) ci
-> (Case {keesje & case_expr = case_expr, case_guards = OverloadedListPatterns type decons_expr algebraic_patterns, case_default = this_case_default}, ci)
(DynamicPatterns dynamic_patterns)
# keesje = {keesje & case_expr = case_expr, case_default = this_case_default}
-> convertDynamicPatterns cinp bound_vars keesje ci
......
......@@ -618,6 +618,8 @@ instance check_completeness CasePatterns where
= check_completeness algebraicPatterns cci ccs
check_completeness (BasicPatterns _ basicPatterns) cci ccs
= check_completeness basicPatterns cci ccs
check_completeness (OverloadedListPatterns _ _ algebraicPatterns) cci ccs
= check_completeness algebraicPatterns cci ccs
check_completeness (DynamicPatterns dynamicPatterns) cci ccs
= check_completeness dynamicPatterns cci ccs
check_completeness NoPattern _ ccs
......
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