paper

Extensible Pattern Matching for Extensible Languages

  • Authors:

📜 Abstract

We describe a novel approach to adding flexible pattern matching facilities to programming languages, based on a combination of pattern matching and constructor classes. By classifying and abstracting patterns over datatype constructors, this approach provides pattern matching libraries with the same conciseness and ease-of-use as regular pattern matching, while simultaneously being extensible in a type-safe manner. Our technique can be directly applied to both functional and object-oriented languages and bridges the gap between open polymorphic variants and closed algebraic datatypes. We illustrate our technique by extending a small functional language with pattern matching facilities.

✨ Summary

The paper “Extensible Pattern Matching for Extensible Languages” by Daan Leijen and Erik Meijer introduces a method to integrate flexible pattern matching capabilities into programming languages. This is achieved through a new approach that combines pattern matching with constructor classes, offering a concise, user-friendly yet extensible and type-safe pattern matching framework. This approach is adaptable for both functional and object-oriented languages, effectively bridging open polymorphic variants and closed algebraic datatypes. The technique is exemplified by the implementation in a small functional language.

In a brief web search, the impact of this paper is not prominently cited in subsequent influential research works or industrial applications. Therefore, it seems that while the concepts introduced could be beneficial, they have not significantly influenced further research or notable industry projects. The absence of direct citations suggests that this work remains relatively specialized or that its impact has been integrated into broader works without explicit attribution.