TL;DR
Hazelnut introduces a formal, bidirectionally typed structure editor calculus that handles incomplete programs with holes, enabling flexible, type-safe program editing and providing a foundation for future tool development.
Contribution
It presents a formal lambda calculus for typed structure editing with holes, extending prior work by handling incomplete terms safely and guiding implementation strategies.
Findings
Hazelnut's semantics support safe editing of incomplete programs.
The calculus connects with gradual typing and modal type theory.
Mechanized in Agda, it informs implementation as a functional reactive system.
Abstract
Structure editors allow programmers to edit the tree structure of a program directly. This can have cognitive benefits, particularly for novice and end-user programmers. It also simplifies matters for tool designers, because they do not need to contend with malformed program text. This paper defines Hazelnut, a structure editor based on a small bidirectionally typed lambda calculus extended with holes and a cursor. Hazelnut goes one step beyond syntactic well-formedness: its edit actions operate over statically meaningful incomplete terms. Naively, this would force the programmer to construct terms in a rigid "outside-in" manner. To avoid this problem, the action semantics automatically places terms assigned a type that is inconsistent with the expected type inside a hole. This safely defers the type consistency check until the term inside the hole is finished. Hazelnut is a…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
