Programming with Ellipses

2026-07-10Programming Languages

Programming Languages
AI summary

The authors describe a way to extend a programming language to use "..." (ellipsis) in patterns and expressions, making it easier to write functions that work on lists without needing complex recursion. They explain how this ellipsis works by translating code and finding common parts of expressions around the ellipsis. Their approach can be used in many different kinds of function definitions and might help people learning functional programming, especially those used to imperative programming. Like list comprehensions, this ellipsis notation adds new syntax options to functional languages and helps make code clearer.

ellipsis notationfunctional programminglist patternsrecursionleast general generalizationlist comprehensionsprogram translationimperative programmingsyntax extensionfunction definitions
Authors
Martin Erwig, Hangil Kim
Abstract
We present the design of a language extension that allows the use of ellipses ("...") in patterns and expressions, which facilitates function definitions on lists that are more succinct and direct than the standard recursive ones. The semantics of ellipsis notation is defined via a program translation that is based on computing least general generalizations of the expressions on the boundary of ellipses. We show that ellipsis notation applies to a wide spectrum of function definitions. Ellipsis notation can also support the teaching of functional programming, and its inherently iterative nature may make it especially helpful to those with an imperative programming background. Like list comprehensions, ellipsis notation provides an attractive tool for functional languages that adds to their syntactic variety and enriches their expressiveness.