Nested case statements in SML
问题 This is more of a stylistic question than anything else. Given the following piece of code: case e1 of (* datatype type_of_e1 = p1 | p2 *) p1 => case e11 of (* datatype type_of_e11 = NONE | SOME int *) NONE => expr11 | SOME v => expr12 v | p2 => case e21 of (* datatype type_of_e21 = NONE | SOME string *) NONE => expr21 | SOME v => expr22 v Is there a way to resolve the types of rules don't agree error caused by trying to pattern match e11 to p2 , other than enclosing p1 's expression in