A promising approach to unifying functional and imperative programming paradigms is to localize mutation using linear or affine types. Haskell, a purely functional language, was recently extended with linear types by Bernardy et al., in the name of Linear Haskell. However, it remained unknown whether such a pure language could safely support non-local borrowing in the style of Rust, where each borrower can be freely split and dropped without direct communication of ownership back to the lender. We answer this question affirmatively with Pure Borrow, a novel framework that realizes Rust-style borrowing in Linear Haskell with purity. Notably, it features parallel state mutation with affine mutable references inside pure computation, unlike the IO and ST monads and existing Linear Haskell APIs. It also enjoys purity, lazy evaluation, first-class polymorphism and leak freedom, unlike Rust. We implement Pure Borrow simply as a library in Linear Haskell and demonstrate its power with a case study in parallel computing. We formalize the core of Pure Borrow and build a metatheory that works toward establishing safety, leak freedom and confluence, with a new, history-based model of borrowing.


翻译:暂无翻译

0
下载
关闭预览

相关内容

KDD25 | 大语言模型能否提高图神经网络的对抗鲁棒性?
专知会员服务
19+阅读 · 2024年12月18日
EMNLP 2024 | 基于知识编辑的大模型敏感知识擦除
专知会员服务
22+阅读 · 2024年11月19日
AAAI 2024 | GCIL:因果视角下的图对比不变学习
专知会员服务
20+阅读 · 2024年3月5日
专知会员服务
10+阅读 · 2021年10月1日
【WWW2021】用优化框架解释和统一图神经网络
专知会员服务
45+阅读 · 2021年2月1日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
Single-Shot Object Detection with Enriched Semantics
统计学习与视觉计算组
14+阅读 · 2018年8月29日
手把手教 | 深度学习库PyTorch(附代码)
数据派THU
27+阅读 · 2018年3月15日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
线性回归:简单线性回归详解
专知
12+阅读 · 2018年3月10日
概率图模型体系:HMM、MEMM、CRF
机器学习研究会
30+阅读 · 2018年2月10日
一文读懂生成对抗网络GANs(附学习资源)
数据派THU
10+阅读 · 2018年2月9日
论文浅尝 | Question Answering over Freebase
开放知识图谱
19+阅读 · 2018年1月9日
From Softmax to Sparsemax-ICML16(1)
KingsGarden
74+阅读 · 2016年11月26日
国家自然科学基金
6+阅读 · 2017年6月30日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Arxiv
0+阅读 · 4月23日
Arxiv
0+阅读 · 4月14日
Arxiv
0+阅读 · 4月13日
VIP会员
相关主题
最新内容
DeepSeek 版Claude Code,免费小白安装教程来了!
专知会员服务
7+阅读 · 5月5日
《美空军条令出版物 2-0:情报(2026版)》
专知会员服务
13+阅读 · 5月5日
帕兰提尔 Gotham:一个游戏规则改变器
专知会员服务
8+阅读 · 5月5日
【综述】 机器人学习中的世界模型:全面综述
专知会员服务
12+阅读 · 5月4日
伊朗的导弹-无人机行动及其对美国威慑的影响
相关资讯
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
Single-Shot Object Detection with Enriched Semantics
统计学习与视觉计算组
14+阅读 · 2018年8月29日
手把手教 | 深度学习库PyTorch(附代码)
数据派THU
27+阅读 · 2018年3月15日
Focal Loss for Dense Object Detection
统计学习与视觉计算组
12+阅读 · 2018年3月15日
线性回归:简单线性回归详解
专知
12+阅读 · 2018年3月10日
概率图模型体系:HMM、MEMM、CRF
机器学习研究会
30+阅读 · 2018年2月10日
一文读懂生成对抗网络GANs(附学习资源)
数据派THU
10+阅读 · 2018年2月9日
论文浅尝 | Question Answering over Freebase
开放知识图谱
19+阅读 · 2018年1月9日
From Softmax to Sparsemax-ICML16(1)
KingsGarden
74+阅读 · 2016年11月26日
相关基金
国家自然科学基金
6+阅读 · 2017年6月30日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
6+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员