arXivDaily arXiv每日学术速递 周一至周五更新
arXiv cs/0212048cs.PL
收藏

策略多态只需要两个组合子!

Strategic polymorphism requires just two combinators!

Ralf Laemmel, Joost Visser

摘要:

在以前的工作中,我们介绍了函数策略的概念:第一类通用函数,可以遍历任何类型的术语,同时混合统一和类型特定的行为。函数式策略将术语重写策略(包括遍历)的概念转移到函数式编程范式中。同时,提出了许多基于Haskell的模型和组合子套件,以支持具有函数式策略的泛型编程。在本文中,我们提供了一个紧凑和成熟的功能策略的重建。我们只通过两个原始的组合子来捕获策略多态性。这是在不承诺特定函数语言的情况下完成的。我们分析了功能策略实施模型的设计空间。为了完整起见,我们还提供了一个用于实现函数策略的操作参考模型(在Haskell中)。我们证明了我们的方法的一般性,通过重建的Strafunski库的功能策略的代表性片段。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑