@@ -34,6 +34,12 @@ let compare_mutable_or_immutable mut1 mut2 =
3434  |  Immutable , Mutable  -> - 1 
3535  |  Mutable , Immutable  -> 1 
3636
37+ let  join_mutable_or_immutable  mut1  mut2  = 
38+   match  mut1, mut2 with 
39+   |  Immutable , Immutable  -> Immutable 
40+   |  Mutable , Mutable 
41+   |  Immutable , Mutable 
42+   |  Mutable , Immutable  -> Mutable 
3743
3844(*  Effects *) 
3945
@@ -64,4 +70,17 @@ let compare eff1 eff2 =
6470  |  Arbitrary_effects , Arbitrary_effects  -> 0 
6571  |  Arbitrary_effects , (No_effects  | Only_generative_effects  _ ) -> 1 
6672
73+ let  join  eff1  eff2  = 
74+   match  eff1, eff2 with 
75+   |  No_effects , No_effects 
76+   |  No_effects , Only_generative_effects  _
77+   |  No_effects , Arbitrary_effects  -> eff2
78+   |  Only_generative_effects  _ , No_effects  -> eff1
79+   |  Only_generative_effects  mut1,
80+     Only_generative_effects  mut2 ->
81+       Only_generative_effects  (join_mutable_or_immutable mut1 mut2)
82+   |  Only_generative_effects  _ , Arbitrary_effects  -> eff2
83+   |  Arbitrary_effects , No_effects 
84+   |  Arbitrary_effects , Only_generative_effects  _
85+   |  Arbitrary_effects , Arbitrary_effects  -> eff1
6786
0 commit comments