Abstract

Functional languages allow the definition of functions by pattern matching, which performs an analysis of the structure of values. However, the structures which can be described by such patterns are restricted to a fixed portion from the root of the value.Context patterns are a new non-local form of patterns, which allow the matching of subterms without fixed distance from the root of the value. Typical applications of context patterns are functions which search a data structure for patterns and transform it by replacing the pattern. In this paper we introduce a new construct called extended context, which allows the definition of transformational functions without superfluous repetition of the recursive search. Furthermore, we present an inference system which formalises the type conditions for context patterns.

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.