-
Notifications
You must be signed in to change notification settings - Fork 44
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
Merge DHExp and UExp #1197
base: dev
Are you sure you want to change the base?
Merge DHExp and UExp #1197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've gone over everything except I only skimmed dynamics. In general this feels pretty solid. Does some much-needed cleanup and generally avoids complecting things. There are some requests for clarifications in the comments but no major changes. I did some basic functional tests, the only issue I've found is the test checkmark thing.
Some general questions:
- Why are we calling TypeAnns casts now? Not against it just curious as to the exact rationale
- What exactly is the role of the layout/DH* modules now? And the DH terminology more broadly? It looks like we're still using the old view layer, except now we convert Exps to DHLayouts? Are we waiting to fully deprecate DH?
- The proliferation of Typ.fresh, fast, etc makes me somewhat question the elimination of the internal Typ.t. We do so much syntax-irrelevant logic on types. Not asking that you roll back this part of the change, just noting that this feels debatable to me.
m: Map.t, | ||
) | ||
: (Info.pat, Map.t) => { | ||
let add = (~self, ~ctx, m) => { | ||
let prev_synswitch = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this doesn't feel obviously consistent with the way prev_synswitch is described in its type definition
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in what way?
To your general questions, @disconcision
|
The current branch also seems to not inherit bound names in stepped code / function output. E.g. in Cyrus's comment above you can see several . Additionally, see the screenshot: See (c119777) also for how this was extended to type functions. |
Ah yeah thanks @Crazycolorz5 - it was an issue with the transition rules for builtin application not using the evaluated version of the argument. |
@Negabinary couple of conflicts to resolve here |
Motivation:
Implements #878,
The advantages of merging DHExp and UExp are:
This pr replaces #931 which replaced #857. I have started again (using the previous iterations as inspiration) because the codebase has changed too much since those prs.
Implementation Strategy
My implementation strategy is to slowly get the two data structures to be as similar as possible, and then work on sharing code between them.
Progress
Chapter 1: Matching up the data structures
FixPersist unbound type variables into Typ.t and show #1150 (will be part of Use Editor code to show outputs as well as inputs #1297)Chapter 2: Removing footguns post-elaboration
Known bugs to fix
Fixpoint binders sometimes show static errors(will be fixed separately with Fixpoints in SynFun position create static errors #1299)5(?)
Fix failed casts on:
type T = +A in A
let f = typfun t -> fun x:t -> x in f@<Int>(5)
let (x,y):(+X, +Y) = (X, Y) in
gives static errorlet x : +X(Int) = X(3) in
has bad castshouldn't allow arrow constructors in patterns(This is an independent problem on dev)Work for future PRs
Notes
At the moment (2024-03-11), in order to add a new construct to the language, you need to:
Exp
inTermBase
.cls_of_term
show_cls
is_tuple_of_functions
append_exp
repair_ids
strip_casts
fast_equals
filter_matcher
matches
uexp_to_info_map
DHDocExp
printingvar_mention
var_applied
find_fn
tail_check