ML-language dialects and related typically support expressive pattern-matching syntaxes which allow programmers to write concise, expressive, and type-safe code to manipulate algebraic data types. Many features have been proposed to enhance the expressiveness of these pattern-matching syntaxes, such as pattern bindings, pattern alternatives (aka dis- junction), pattern conjunction, view patterns, pattern guards, ‘if-let’ patterns, multi-way if-expressions, etc.
In this extended abstract, we propose a new framework for expressing pattern-matching code in a way that is both more expressive and (we argue) more readable than previous alternatives. In particular, our syntax subsumes many proposed extensions to ML pattern matching by allowing parallel and nested matches interleaved with computations and intermediate bindings. This is achieved through a form of nested multi-way if-expressions, an expression-splitting mechanism to factor common conditional prefixes, and a technique we call conditional pattern flowing.
We present many examples of this new syntax in the setting of MLscript, a new ML-family programming language that is being developed at the Hong Kong University of Science and Technology.
|Slides PDF (ml22-ucs.pdf)||1.64MiB|
I am an Assistant Professor at the HKUST CSE department since February 2021. I am looking for students to join my research group! Please contact me (first-name dot last-name at gmail.com) if you’d like to work on something related to programming languages, type systems, or compiler optimization.
I obtained my PhD in 2020 at EPFL, in the Data Analysis Theory and Applications Laboratory (DATA), where I created the Squid type-safe metaprogramming library for Scala.
Thu 15 SepDisplayed time zone: Belgrade, Bratislava, Budapest, Ljubljana, Prague change
09:00 - 10:30
|Efficient and Scalable Parallel Functional Programming Through Disentanglement|
Sam Westrick Carnegie Mellon University
|Towards Algebraic Subtyping for Extensible Records|
|The Ultimate Conditional SyntaxVirtual|
Lionel Parreaux The Hong Kong University of Science and Technology (HKUST)Pre-print File Attached