首页    期刊浏览 2024年11月29日 星期五
登录注册

文章基本信息

  • 标题:When is a container a comonad?
  • 本地全文:下载
  • 作者:Danel Ahman ; James Chapman ; Tarmo Uustalu
  • 期刊名称:Logical Methods in Computer Science
  • 印刷版ISSN:1860-5974
  • 电子版ISSN:1860-5974
  • 出版年度:2014
  • 卷号:10
  • 期号:3
  • 页码:1
  • DOI:10.2168/LMCS-10(3:14)2014
  • 出版社:Technical University of Braunschweig
  • 摘要:Abbott, Altenkirch, Ghani and others have taught us that many parameterized datatypes (set functors) can be usefully analyzed via container representations in terms of a set of shapes and a set of positions in each shape. This paper builds on the observation that datatypes often carry additional structure that containers alone do not account for. We introduce directed containers to capture the common situation where every position in a data-structure determines another data-structure, informally, the sub-data-structure rooted by that position. Some natural examples are non-empty lists and node-labelled trees, and data-structures with a designated position (zippers). While containers denote set functors via a fully-faithful functor, directed containers interpret fully-faithfully into comonads. But more is true: every comonad whose underlying functor is a container is represented by a directed container. In fact, directed containers are the same as containers that are comonads. We also describe some constructions of directed containers. We have formalized our development in the dependently typed programming language Agda.
  • 其他关键词:containers, comonads, datatypes, dependently typed programming, Agda
国家哲学社会科学文献中心版权所有