Transporting functions across ornaments

Transporting functions across ornaments
复制标题

跨装饰品传输功能

DOI:
10.1145/2398856.2364544
复制
发表时间:
2012
影响因子:
--
通讯作者:
Dagand P
Dagand P
中科院分区:
--
文献类型:
--
作者:
Dagand P

文献摘要

参考文献

被引文献

相似文献

使用依赖类型进行编程是一件好事,也是一件坏事。能够在数据类型的定义中加入不变量是一件幸事:我们终于可以编写构造正确的软件了。然而,这种极端的准确性也是一种诅咒:数据类型是结构介质与特殊用途逻辑的组合。这些特定于领域的逻辑阻碍了类似结构数据之间代码重用的任何努力。在本文中,我们通过将装饰的概念应用于归纳族的范畴来消除我们的数据类型。然后我们将展示如何通过修饰函数来实现代码重用。使用这些功能性装饰,我们捕捉到功能之间的关系,例如自然数的加法和列表的连接。有了这些知识,我们将演示前者的实现如何通知后者的实现:用户可以要求将加法的定义提升到列表中,并且只向她询问进行添加列表所需的细节,而不是数字。我们的表示是在一个数据类型范围的类型理论中形式化的,我们所有的结构都被实现为泛型程序,不需要对类型理论进行扩展。
Programming with dependent types is a blessing and a curse. It is a blessing to be able to bake invariants into the definition of datatypes: we can finally write correct-by-construction software. However, this extreme accuracy is also a curse: a datatype is the combination of a structuring medium together with a special purpose logic. These domain-specific logics hamper any effort of code reuse among similarly structured data. In this paper, we exorcise our datatypes by adapting the notion of ornament to our universe of inductive families. We then show how code reuse can be achieved by ornamenting functions. Using these functional ornaments, we capture the relationship between functions such as the addition of natural numbers and the concatenation of lists. With this knowledge, we demonstrate how the implementation of the former informs the implementation of the latter: the user can ask the definition of addition to be lifted to lists and she will only be asked the details necessary to carry on adding lists rather than numbers. Our presentation is formalised in a type theory with a universe of datatypes and all our constructions have been implemented as generic programs, requiring no extension to the type theory.
关于构造函数的一些构造
DOI: --
发表时间: 2004
期刊: Types for Proofs and Programs
影响因子: --
作者:
Conor McBride;H. Goguen;James McKinna
通讯作者: James McKinna
类型细化何时是归纳类型?
DOI: --
发表时间: 2011
期刊: Foundations of Software Science and Computation Structure
影响因子: --
作者:
R. Atkey;Patricia Johann;Neil Ghani
通讯作者: Neil Ghani
装饰代数、代数装饰品
DOI: --
发表时间: 2014
期刊:
影响因子: --
作者:
N. Gumede;A. Young;J. Coetzee
通讯作者: J. Coetzee
DOI: 10.1109/lics.1994.316071
发表时间: 1994-07
期刊: Proceedings Ninth Annual IEEE Symposium on Logic in Computer Science
影响因子: --
作者:
M. Hofmann;T. Streicher
通讯作者: M. Hofmann;T. Streicher
轻柔的悬浮艺术
DOI: 10.1145/1932681.1863547
发表时间: 2010
影响因子: --
作者:
Chapman J
通讯作者: Chapman J