Haskell的类型不变量

T. Schrijvers, Louis-Julien Guillemette, Stefan Monnier
{"title":"Haskell的类型不变量","authors":"T. Schrijvers, Louis-Julien Guillemette, Stefan Monnier","doi":"10.1145/1481848.1481855","DOIUrl":null,"url":null,"abstract":"Multi-parameter type classes, functional dependencies, and recently GADTs and open type families open up opportunities to use complex type-level programming to let GHC's type checker verify various properties of your programs. But type-level code is special in that its correctness is crucial to the safety of the program; so except in those cases simple enough for the type checker to see trivially that the code is correct (or harmless), type-level programs need to come with a specification of their properties together with their proof.\n In this article, we propose an extension to Haskell that allows the specification of invariants for type classes and open type families, together with accompanying evidence that those invariants hold. To accommodate the open nature of type classes and type families, the evidence itself needs to be open and every subcase of the proof can be provided independently from the others.","PeriodicalId":153056,"journal":{"name":"Programming Languages meets Program Verification","volume":"102 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2009-01-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"3","resultStr":"{\"title\":\"Type invariants for Haskell\",\"authors\":\"T. Schrijvers, Louis-Julien Guillemette, Stefan Monnier\",\"doi\":\"10.1145/1481848.1481855\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Multi-parameter type classes, functional dependencies, and recently GADTs and open type families open up opportunities to use complex type-level programming to let GHC's type checker verify various properties of your programs. But type-level code is special in that its correctness is crucial to the safety of the program; so except in those cases simple enough for the type checker to see trivially that the code is correct (or harmless), type-level programs need to come with a specification of their properties together with their proof.\\n In this article, we propose an extension to Haskell that allows the specification of invariants for type classes and open type families, together with accompanying evidence that those invariants hold. To accommodate the open nature of type classes and type families, the evidence itself needs to be open and every subcase of the proof can be provided independently from the others.\",\"PeriodicalId\":153056,\"journal\":{\"name\":\"Programming Languages meets Program Verification\",\"volume\":\"102 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2009-01-20\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"3\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Programming Languages meets Program Verification\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/1481848.1481855\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Programming Languages meets Program Verification","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1481848.1481855","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 3

摘要

多参数类型类、函数依赖以及最近的gadt和开放类型族为使用复杂的类型级编程提供了机会,从而让GHC的类型检查器验证程序的各种属性。但是类型级代码的特殊之处在于它的正确性对程序的安全性至关重要;因此,除了那些简单到足以让类型检查器看到代码是正确的(或无害的)的情况外,类型级程序需要提供其属性的规范以及它们的证明。在本文中,我们提出对Haskell的扩展,它允许指定类型类和开放类型族的不变量,并附带证明这些不变量成立的证据。为了适应类型类和类型族的开放性,证据本身需要是开放的,并且证明的每个子案例都可以独立于其他子案例提供。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Type invariants for Haskell
Multi-parameter type classes, functional dependencies, and recently GADTs and open type families open up opportunities to use complex type-level programming to let GHC's type checker verify various properties of your programs. But type-level code is special in that its correctness is crucial to the safety of the program; so except in those cases simple enough for the type checker to see trivially that the code is correct (or harmless), type-level programs need to come with a specification of their properties together with their proof. In this article, we propose an extension to Haskell that allows the specification of invariants for type classes and open type families, together with accompanying evidence that those invariants hold. To accommodate the open nature of type classes and type families, the evidence itself needs to be open and every subcase of the proof can be provided independently from the others.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信