I am writing a compiler for a functional language I designed with OCaml. I want my little language to have the feature of pattern matching, however, I got stuck in coming up wit
There's a few good papers on compiling pattern matching by some of the people behind OCaml. In particular see Compiling Pattern Matching to Good Decision Trees and Optimizing Pattern Matching. It might also be useful to go over this stackoverflow post.