Additional info for custom data types:
The AST type for the data types looks like
| M_data (String,[(String,[M_type])])
Here, the initial string corresponds to the name of the type, next is the list of constructors, each on having a name (the string), and a list of types being used.
Case statements are used in conjuction with these data types. The AST node for this looks like:
| M_case (M_expr,[(String,[String],M_stmt)])
The first expression evaluates to the variable the case statement operates on. This is followed by a list of triples which represents the cases. The first String is the name of the constructor being used, the list of strings is the parameter list for the constructor, and the statement is the action to be taken if the M_expr matches the pattern seen in the case.