什么时候容器是comonad?
When is a container a comonad?
摘要:
Abbott、Altenkirch、Ghani和其他人告诉我们,许多参数化的数据集(集合函子)可以通过容器表示来有效地分析,这些容器表示是一组形状和每个形状中的一组位置。本文建立在这样一种观察的基础上,即数据库经常携带容器本身无法解释的额外结构。我们引入有向容器来捕捉常见的情况,即数据结构中的每个位置都决定了另一个数据结构,非正式地说,子数据结构以该位置为根。一些自然的例子是非空列表和节点标记树,以及具有指定位置的数据结构(拉链)。虽然容器通过完全忠实的函子表示集合函子,但有向容器完全忠实地解释为comonad。但更多的是真的:每个comonad的底层函子是一个容器是由一个有向容器表示。事实上,定向容器与作为comonad的容器是一样的。我们还描述了一些有向容器的构造。我们已经用依赖类型的程序设计语言Agda形式化了我们的开发。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。