分次线性类型的分布律推导
Deriving Distributive Laws for Graded Linear Types
摘要:
最近提出的分级模态类型概念为用细粒度数据流推理扩展类型论提供了一个框架。Granule语言在线性类型的上下文中探讨了这一思想。在这个实际的设置中,我们观察到分级模态类型的存在可能会在编程时引入额外的障碍:在编写程序时,通常需要在分级模态上“分布”数据类型,反之亦然。在本文中,我们将展示如何自动导出这些分配律作为编程的组合子。我们讨论的实现和使用这种自动化的派生过程中的颗粒,提供方便地访问这些分布式组合。这项工作也适用于线性Haskell(通过分级用线性类型改造Haskell),我们在那里应用我们的技术来提供相同的自动派生组合子。在此过程中,我们讨论了通过分级线性类型进行模式匹配分析的有趣考虑。最后,我们展示了其他有用的结构组合子也可以自动派生。
英文摘要:
The recent notion of graded modal types provides a framework for extending type theories with fine-grained data-flow reasoning. The Granule language explores this idea in the context of linear types. In this practical setting, we observe that the presence of graded modal types can introduce an additional impediment when programming: when composing programs, it is often necessary to 'distribute' data types over graded modalities, and vice versa. In this paper, we show how to automatically derive these distributive laws as combinators for programming. We discuss the implementation and use of this automated deriving procedure in Granule, providing easy access to these distributive combinators. This work is also applicable to Linear Haskell (which retrofits Haskell with linear types via grading) and we apply our technique there to provide the same automatically derived combinators. Along the way, we discuss interesting considerations for pattern matching analysis via graded linear types. Lastly, we show how other useful structural combinators can also be automatically derived.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。