The Ultimate Conditional Syntax

Date:

Pattern matching on algebraic datatypes is the cornerstone of functional programming as it allows us to write code which is concise and type safe. But can it be more expressive and more readable compared to existing implementations in languages like OCaml and Haskell? I presented a paper that introduces the ultimate conditional syntax (UCS) — treating pattern matching as a generalization of if-then-else by adding destructing and binding capabilities to boolean expressions. This allows us to write nested multi-way if-expressions which can be split in arbitrary ways. I will first talk about these key features of UCS, followed by describing the source syntax. I will then talk about how UCS is compiled into a core language which is simpler, and how the compilation handles problems like backtracking, missing, and redundant cases. Finally, I will talk about how UCS compares to existing approaches in terms of expressiveness, type checking, and practicality of usage.