多形态交响乐素描
The Sketch of a Polymorphic Symphony
摘要:
在以前的工作中,我们已经介绍了功能策略,也就是说,一流的通用功能,可以遍历到任何类型的条款,同时混合统一和类型特定的行为。在本文中,我们给出了一个特定的基于Haskell模型的功能策略的详细描述。该模型的特点如下。首先,我们采用一级多态性作为一种形式的二阶多态性的纯粹类型的功能策略。其次,我们使用一个编码方案的运行时类型的情况下混合均匀和类型特定的行为。第三,我们将所有遍历建立在一个基本的组合子上,用于折叠构造器应用程序。使用这个模型,我们捕捉到一个高度参数化的风格常见的战略遍历方案。我们研究两种原始形式的参数化。首先针对具体的控制流、数据流和遍历特性设计参数,给出更具体的遍历方案。其次,我们使用重载来推迟提交到特定类型的遍历方案。由此产生的组合遍历方案可以被视为一个具有挑战性的基准设置类型泛型编程。我们开发模型和遍历方案套件的方式,很明显,参数化+类型化战略规划最好被视为参数,内涵,多型和ad-hoc多态性的某些位的有效组合。
英文摘要:
In previous work, we have introduced functional strategies, that is, first-class generic functions that can traverse into terms of any type while mixing uniform and type-specific behaviour. In the present paper, we give a detailed description of one particular Haskell-based model of functional strategies. This model is characterised as follows. Firstly, we employ first-class polymorphism as a form of second-order polymorphism as for the mere types of functional strategies. Secondly, we use an encoding scheme of run-time type case for mixing uniform and type-specific behaviour. Thirdly, we base all traversal on a fundamental combinator for folding over constructor applications. Using this model, we capture common strategic traversal schemes in a highly parameterised style. We study two original forms of parameterisation. Firstly, we design parameters for the specific control-flow, data-flow and traversal characteristics of more concrete traversal schemes. Secondly, we use overloading to postpone commitment to a specific type scheme of traversal. The resulting portfolio of traversal schemes can be regarded as a challenging benchmark for setups for typed generic programming. The way we develop the model and the suite of traversal schemes, it becomes clear that parameterised + typed strategic programming is best viewed as a potent combination of certain bits of parametric, intensional, polytypic, and ad-hoc polymorphism.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。