Skip to content

The Ultimate Conditional Syntax #260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 8, 2025
Merged

The Ultimate Conditional Syntax #260

merged 1 commit into from
Mar 8, 2025

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Mar 8, 2025

This paper was randomly selected as your next reading.

The Ultimate Conditional Syntax

Functional programming languages typically support expressive patternmatching syntax allowing programmers to write concise and typesafe code, especially appropriate for manipulating algebraic data types. Many features have been proposed to enhance the expressiveness of stock patternmatching syntax, such as pattern bindings, pattern alternatives a.k.a. disjunction, pattern conjunction, view patterns, pattern guards, pattern synonyms, active patterns, iflet patterns, multiway ifexpressions, etc. In this paper, we propose a new patternmatching syntax that is both more expressive and we argue simpler and more readable than previous alternatives. Our syntax supports parallel and nested matches interleaved with computations and intermediate bindings. This is achieved through a form of nested multiway ifexpressions with a conditionsplitting mechanism to factor common conditional prefixes as well as a binding technique we call conditional pattern flowing. We motivate this new syntax with many examples in the setting of MLscript, a new MLfamily programming language. We describe a straightforward desugaring pass from our rich source syntax into a minimal core syntax that only supports

Cheng, Luyu, and Lionel Parreaux. “The Ultimate Conditional Syntax. Proceedings of the ACM on Programming Languages, vol. 8, no. OOPSLA2, Oct. 2024, pp. 9881017. Crossref, https://doi.org/10.1145/3689746.

Merge this PR to apply selection.

@nkrusch nkrusch merged commit 5ba6b22 into main Mar 8, 2025
@nkrusch nkrusch deleted the next-paper branch March 8, 2025 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant