@InProceedings{Tullsen:PADL2000, author = "Mark Tullsen", year = "2000", month = jan, title = "First Class Patterns", booktitle = "Practical Aspects of Declarative Languages, Second International Workshop, PADL 2000", editor = "E. Pontelli and V. Santos Costa", publisher = "Springer-Verlag", series = "Lecture Notes in Computer Science", volume = "1753", pages = "1-15", abstract = "Pattern matching is a great convenience in programming. However, pattern matching has its problems: it conflicts with data abstraction; it is complex (at least in Haskell, which has pattern guards, irrefutable patterns, n+k patterns, as patterns, etc.); it is a source of run-time errors; and lastly, one cannot abstract over patterns as they are not a first class language construct.This paper proposes a simplification of pattern matching that makes patterns first class. The key idea is to treat patterns as functions of type ``a -> Maybe b'' ---i.e., ``a -> (Nothing|Just b)''; thus, patterns and pattern combinators can be written as functions in the language.", }