Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHI 12 - tiles & bottom-up zipper #14

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions 12-tiles-and-bottom-up-zipper/12-tiles-and-bottom-up-zipper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Summary

The first step toward a tile-based editor will be a pure refactor (modulo fixing
some bugs or smoothing out some small but awkward ux details along the way).

This refactor will reorganize the Hazel codebase around two central concepts: a
tile-based syntax and a bottom-up zipper based edit state.

A tile-based syntax will generalize our existing `OpSeq`-based syntax to better
support prefix/postfix unary operators and unifies current structural
discrepancies across sorts (eg blocks/lines in expressions but not
types/patterns).

A bottom-up zipper based edit state, a departure from our current top-down
zipper structure (see `ZExp`/`ZPat`/`ZTyp`), will enable vastly better reuse of
type checking logic across our codebase, in particular the logic for propagating
type-contextual information down the tree. A bottom-up zipper splits the program
tree into a subject (what is currently focused) and a frame (everything else).
Having a frame datatype allows us to write the type-contextual info propagation
logic once and reuse as needed without having to write a new type-directed
recursive traversal as we currently do.