This PR will migrate the previous work done by @LeoQiao18 on desugaring pattern matching from AST to IR.
The rationale behind this migration is to ensure that the desugaring pass only happens after type-checking. Type correctness is assumed by most desugaring algorithms, and doing desugaring in the AST can lead to potential hazards, such as accidentally transforming ill-typed expressions to well-typed expressions or vice versa.
This PR will migrate the previous work done by @LeoQiao18 on desugaring pattern matching from AST to IR.
The rationale behind this migration is to ensure that the desugaring pass only happens after type-checking. Type correctness is assumed by most desugaring algorithms, and doing desugaring in the AST can lead to potential hazards, such as accidentally transforming ill-typed expressions to well-typed expressions or vice versa.