计算机科学 > 程序设计语言
[提交于 2012年2月14日]
标题:A Formal Comparison of Approaches to Datatype-Generic Programming
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要:Datatype-generic programming increases program abstraction and reuse by making functions operate uniformly across different types. Many approaches to generic programming have been proposed over the years, most of them for Haskell, but recently also for dependently typed languages such as Agda. Different approaches vary in expressiveness, ease of use, and implementation techniques. Some work has been done in comparing the different approaches informally. However, to our knowledge there have been no attempts to formally prove relations between different approaches. We thus present a formal comparison of generic programming libraries. We show how to formalise different approaches in Agda, including a coinductive representation, and then establish theorems that relate the approaches to each other. We provide constructive proofs of inclusion of one approach in another that can be used to convert between approaches, helping to reduce code duplication across different libraries. Our formalisation also helps in providing a clear picture of the potential of each approach, especially in relating different generic views and their expressiveness.
提交历史
来自:EPTCS[v1] 2012年2月14日 星期二 03:01:41 UTC