匹配镜头:对准和视图更新

Davi Barbosa, Julien Cretin, Nate Foster, M. Greenberg, B. Pierce
{"title":"匹配镜头:对准和视图更新","authors":"Davi Barbosa, Julien Cretin, Nate Foster, M. Greenberg, B. Pierce","doi":"10.1145/1863543.1863572","DOIUrl":null,"url":null,"abstract":"Bidirectional programming languages are a practical approach to the view update problem. Programs in these languages, called lenses, define both a view and an update policy - i.e., every program can be read as a function mapping sources to views as well as one mapping updated views back to updated sources.\n One thorny issue that has not received sufficient attention in the design of bidirectional languages is alignment. In general, to correctly propagate an update to a view, a lens needs to match up the pieces of the view with the corresponding pieces of the underlying source, even after data has been inserted, deleted, or reordered. However, existing bidirectional languages either support only simple strategies that fail on many examples of practical interest, or else propose specific strategies that are baked deeply into the underlying theory.\n We propose a general framework of matching lenses that parameterizes lenses over arbitrary heuristics for calculating alignments. We enrich the types of lenses with \"chunks\" identifying reorderable pieces of the source and view that should be re-aligned after an update, and we formulate behavioral laws that capture essential constraints on the handling of chunks. We develop a core language of matching lenses for strings, together with a set of \"alignment combinators\" that implement a variety of alignment strategies.","PeriodicalId":20504,"journal":{"name":"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming","volume":"1025 1","pages":"193-204"},"PeriodicalIF":0.0000,"publicationDate":"2010-09-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"84","resultStr":"{\"title\":\"Matching lenses: alignment and view update\",\"authors\":\"Davi Barbosa, Julien Cretin, Nate Foster, M. Greenberg, B. Pierce\",\"doi\":\"10.1145/1863543.1863572\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Bidirectional programming languages are a practical approach to the view update problem. Programs in these languages, called lenses, define both a view and an update policy - i.e., every program can be read as a function mapping sources to views as well as one mapping updated views back to updated sources.\\n One thorny issue that has not received sufficient attention in the design of bidirectional languages is alignment. In general, to correctly propagate an update to a view, a lens needs to match up the pieces of the view with the corresponding pieces of the underlying source, even after data has been inserted, deleted, or reordered. However, existing bidirectional languages either support only simple strategies that fail on many examples of practical interest, or else propose specific strategies that are baked deeply into the underlying theory.\\n We propose a general framework of matching lenses that parameterizes lenses over arbitrary heuristics for calculating alignments. We enrich the types of lenses with \\\"chunks\\\" identifying reorderable pieces of the source and view that should be re-aligned after an update, and we formulate behavioral laws that capture essential constraints on the handling of chunks. We develop a core language of matching lenses for strings, together with a set of \\\"alignment combinators\\\" that implement a variety of alignment strategies.\",\"PeriodicalId\":20504,\"journal\":{\"name\":\"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming\",\"volume\":\"1025 1\",\"pages\":\"193-204\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2010-09-27\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"84\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1145/1863543.1863572\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1863543.1863572","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 84

摘要

双向编程语言是解决视图更新问题的一种实用方法。这些语言中的程序被称为透镜,它们定义了一个视图和一个更新策略——也就是说,每个程序都可以作为一个函数将源映射到视图,也可以作为一个函数将更新后的视图映射回更新后的源。在双向语言的设计中,一个没有得到足够重视的棘手问题是对齐。通常,为了正确地将更新传播到视图,镜片需要将视图的各个部分与底层源的相应部分相匹配,即使在插入、删除或重新排序数据之后也是如此。然而,现有的双向语言要么只支持简单的策略,而这些策略在许多实际的例子中都失败了,要么就提出了深入基础理论的特定策略。我们提出了一种匹配透镜的一般框架,该框架将透镜参数化,用于计算对齐的任意启发式。我们用“块”来丰富镜头的类型,这些“块”标识了在更新后应该重新排列的源和视图的可重新排序的部分,并且我们制定了行为定律,这些定律捕获了处理块的基本约束。我们开发了一种匹配字符串透镜的核心语言,以及一组实现各种对齐策略的“对齐组合子”。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
Matching lenses: alignment and view update
Bidirectional programming languages are a practical approach to the view update problem. Programs in these languages, called lenses, define both a view and an update policy - i.e., every program can be read as a function mapping sources to views as well as one mapping updated views back to updated sources. One thorny issue that has not received sufficient attention in the design of bidirectional languages is alignment. In general, to correctly propagate an update to a view, a lens needs to match up the pieces of the view with the corresponding pieces of the underlying source, even after data has been inserted, deleted, or reordered. However, existing bidirectional languages either support only simple strategies that fail on many examples of practical interest, or else propose specific strategies that are baked deeply into the underlying theory. We propose a general framework of matching lenses that parameterizes lenses over arbitrary heuristics for calculating alignments. We enrich the types of lenses with "chunks" identifying reorderable pieces of the source and view that should be re-aligned after an update, and we formulate behavioral laws that capture essential constraints on the handling of chunks. We develop a core language of matching lenses for strings, together with a set of "alignment combinators" that implement a variety of alignment strategies.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
1ML - core and modules united (F-ing first-class modules) Functional programming for dynamic and large data with self-adjusting computation A theory of gradual effect systems Building embedded systems with embedded DSLs Homotopical patch theory
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1