@inproceedings{syme2007extensible, author = {Syme, Don and Neverov, Gregory and Margetson, James}, title = {Extensible pattern matching via a lightweight language extension}, booktitle = {Proceedings of the 12th ACM SIGPLAN international conference on Functional programming}, year = {2007}, month = {October}, abstract = {Pattern matching of algebraic data types (ADTs) is a standard feature in typed functional programming languages, but it is well known that it interacts poorly with abstraction. While several partial solutions to this problem have been proposed, few have been implemented or used. This paper describes an extension to the .NET language F# called active patterns, which supports pattern matching over abstract representations of generic heterogeneous data such as XML and term structures, including where these are represented via object models in other .NET languages. Our design is the first to incorporate both ad hoc pattern matching functions for partial decompositions and "views" for total decompositions, and yet remains a simple and lightweight extension. We give a description of the language extension along with numerous motivating examples. Finally we describe how this feature would interact with other reasonable and related language extensions: existential types quantified at data discrimination tags, GADTs, and monadic generalizations of pattern matching.}, publisher = {Association for Computing Machinery, Inc.}, url = {http://approjects.co.za/?big=en-us/research/publication/extensible-pattern-matching-via-a-lightweight-language-extension/}, edition = {Proceedings of the 12th ACM SIGPLAN international conference on Functional programming }, }