Strategic polymorphism requires just two combinators!
نویسندگان
چکیده
In previous work, we introduced the notion of functional strategies: first-class generic functions that can traverse terms of any type while mixing uniform and type-specific behaviour. Functional strategies transpose the notion of term rewriting strategies (with coverage of traversal) to the functional programming paradigm. Meanwhile, a number of Haskell-based models and combinator suites were proposed to support generic programming with functional strategies. In the present paper, we provide a compact and matured reconstruction of functional strategies. We capture strategic polymorphism by just two primitive combinators. This is done without commitment to a specific functional language. We analyse the design space for implementational models of functional strategies. For completeness, we also provide an operational reference model for implementing functional strategies (in Haskell). We demonstrate the generality of our approach by reconstructing representative fragments of the Strafunski library for functional strategies. 1998 ACM Computing Classification System: D.3.3
منابع مشابه
Variable Substitution with Iconic Combinators
An iconic notation for representing combinators is introduced , and the extensions of combinatory logic needed to work with it are developed. It is shown how entire sets of combinators can be deened by just two rules for constructing and interpreting iconic names. The two rules { a general abstraction rule and a general reduction rule { are the only ones required to perform variable substitutio...
متن کاملStack-based Strategic Control
In a strategic framework, combinators provide a fundamental mechanism for exercising control over rewriting. This type of control is based on the observation of the success or failure of strategy application. This paper describes a framework where information relating to the outcome of strategy application is stored in two internally maintained stacks. These stacks represent an implicit state w...
متن کاملFeature-Oriented Programming with Object Algebras
Object algebras are a new programming technique that enables a simple solution to basic extensibility and modularity issues in programming languages. While object algebras excel at defining modular features, the composition mechanisms for object algebras (and features) are still cumbersome and limited in expressiveness. In this paper we leverage two well-studied type system features, intersecti...
متن کاملTag-Free Combinators for Binding-Time Polymorphic Program Generation
Binding-time polymorphism enables a highly flexible bindingtime analysis for offline partial evaluation. This work provides the tools to translate this flexibility into efficient program specialization in the context of a polymorphic language. Following the cogen-combinator approach, a set of combinators is defined in Haskell that enables the straightforward transcription of a bindingtime polym...
متن کاملar X iv : c s / 02 05 01 8 v 1 [ cs . P L ] 1 4 M ay 2 00 2 Typed Generic Traversal With Term Rewriting Strategies
A typed model of strategic term rewriting is developed. The key innovation is that generic traversal is covered. To this end, we define a typed rewriting calculus S γ . The calculus employs a many-sorted type system extended by designated generic strategy types γ. We consider two generic strategy types, namely the types of type-preserving and type-unifying strategies. S γ offers traversal combi...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- CoRR
دوره cs.PL/0212048 شماره
صفحات -
تاریخ انتشار 2002