Live Pattern Matching with Typed Holes
Live Pattern Matching with Typed Holes
复制标题
与键入的孔进行实时图案匹配
DOI:
10.1145/3586048
复制
发表时间:
2023
影响因子:
--
通讯作者:
Omar, Cyrus
中科院分区:
文献类型:
--
作者:
Yuan, Yongwei;Guest, Scott;Griffis, Eric;Potter, Hannah;Moon, David;Omar, Cyrus
Several modern programming systems, including GHC Haskell, Agda, Idris, and Hazel, supporttyped holes. Assigning static and, to varying degree, dynamic meaning to programs with holes allows program editors and other tools to offer meaningful feedback and assistance throughout editing, i.e. in alivemanner. Prior work, however, has considered only holes appearing in expressions and types. This paper considers, from type theoretic and logical first principles, the problem of typed pattern holes. We confront two main difficulties, (1) statically reasoning about exhaustiveness and irredundancy when patterns are not fully known, and (2) live evaluation of expressions containing both pattern and expression holes. In both cases, this requires reasoning conservatively about all possible hole fillings. We develop a typed lambda calculus, Peanut, where reasoning about exhaustiveness and redundancy is mapped to the problem of deriving first order entailments. We equip Peanut with an operational semantics in the style of Hazelnut Live that allows us to evaluate around holes in both expressions and patterns. We mechanize the metatheory of Peanut in Agda and formalize a procedure capable of deciding the necessary entailments. Finally, we scale up and implement these mechanisms within Hazel, a programming environment for a dialect of Elm that automatically inserts holes during editing to provide static and dynamic feedback to the programmer in a maximally live manner, i.e. for every possible editor state. Hazel is the first maximally live environment for a general-purpose functional language.
登录
查看更多内容
DOI:
10.1145/2784731.2784748
发表时间:
2015
期刊:
Proceedings of the 20th ACM SIGPLAN International Conference on Functional Programming
影响因子:
--
作者:
G. Karachalias;Tom Schrijvers;Dimitrios Vytiniotis;S. Jones
通讯作者:
S. Jones
DOI:
10.1145/1480881.1480927
发表时间:
2009
期刊:
ACM Trans. Program. Lang. Syst.
影响因子:
--
作者:
N. Krishnaswami
通讯作者:
N. Krishnaswami
影响因子:
1.3
作者:
Lennon-Bertrand,Meven;Maillard,Kenji;Tanter,Eric
通讯作者:
Tanter,Eric
DOI:
--
发表时间:
2017
期刊:
Summit on Advances in Programming Languages
影响因子:
--
作者:
Cyrus Omar;Ian Voysey;Michael C Hilton;Joshua Sunshine;Claire Le Goues;Jonathan Aldrich;Matthew A. Hammer
通讯作者:
Matthew A. Hammer
影响因子:
1.1
作者:
CONVENT L
通讯作者:
CONVENT L