A linear argument must be consumed exactly once in the body of its function. A linear type system can verify the correct usage of resources such as file handles and manually managed memory. But this verification requires bureaucracy. This paper presents linear constraints, a front-end feature for linear typing that decreases the bureaucracy of working with linear types. Linear constraints are implicit linear arguments that are to be filled in automatically by the compiler. Linear constraints are presented as a qualified type system,together with an inference algorithm which extends GHC's existing constraint solver algorithm. Soundness of linear constraints is ensured by the fact that they desugar into Linear Haskell.


翻译:线性参数必须在其函数正文中完全消化一次。 线性类型系统可以核查文件把手和手动管理的内存等资源的正确使用。 但这种核查需要官僚主义。 本文提供了线性限制, 这是线性打字的前端特征, 减少了线性工作类型的官僚主义。 线性限制是线性隐含的线性参数, 由编译者自动填充。 线性限制作为合格的类型系统提出, 加上一种推论算算法, 扩展了 GHC 现有的约束求解算法。 线性限制的正确性得到保证, 因为它们会从Linear Haskell 中解析出来。

0
下载
关闭预览

相关内容

【AAAI2021】对比聚类,Contrastive Clustering
专知会员服务
78+阅读 · 2021年1月30日
《DeepGCNs: Making GCNs Go as Deep as CNNs》
专知会员服务
31+阅读 · 2019年10月17日
2019年机器学习框架回顾
专知会员服务
36+阅读 · 2019年10月11日
分布式并行架构Ray介绍
CreateAMind
10+阅读 · 2019年8月9日
逆强化学习-学习人先验的动机
CreateAMind
16+阅读 · 2019年1月18日
无监督元学习表示学习
CreateAMind
27+阅读 · 2019年1月4日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
Arxiv
0+阅读 · 2021年11月7日
Arxiv
6+阅读 · 2021年6月24日
Arxiv
8+阅读 · 2021年5月21日
Arxiv
8+阅读 · 2021年2月8日
VIP会员
相关资讯
分布式并行架构Ray介绍
CreateAMind
10+阅读 · 2019年8月9日
逆强化学习-学习人先验的动机
CreateAMind
16+阅读 · 2019年1月18日
无监督元学习表示学习
CreateAMind
27+阅读 · 2019年1月4日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
相关论文
Arxiv
0+阅读 · 2021年11月7日
Arxiv
6+阅读 · 2021年6月24日
Arxiv
8+阅读 · 2021年5月21日
Arxiv
8+阅读 · 2021年2月8日
Top
微信扫码咨询专知VIP会员