Context Patterns in Haskell Markus Mohnen Lehrstuhl für Informatik II, RWTH Aachen, Germany mohnen@informatik.rwth-aachen.de Abstract. In modern functional languages, pattern matching is used to define functions or expressions by performing an analysis of the structure of values. We extend Haskell with a new non-local form of patterns called context patterns, which allow the matching of subterms without fixed distance from the root of the whole term. The semantics of context patterns is defined by transforming them to standard Haskell programs. Typical applications of context patterns are functions which search a data structure and possibly transform it. This concept can easily be adopted for other languages using pattern matching like ML or Clean.