-
Notifications
You must be signed in to change notification settings - Fork 0
Rec_info: Add coercions #317
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
Rec_info: Add coercions #317
Conversation
* Use `Coercion.t` rather than `Coercion.t option` in many places * Use `Rec_info.t` again where sensible (in making inlining decisions, for instance), but redefine it as `unit` pending the next phase of `Rec_info` overhaul * Add simple `int` fields to `Coercion.t` for changing recursion depth; this is simpler than what we'll actually need but specific enough that we can test meaningfully (e.g., we can tell whether coercions are composed in the right order)
bea20c4
to
29b5420
Compare
@@ -18,6 +18,12 @@ | |||
|
|||
[@@@ocaml.warning "+a-4-30-40-41-42"] | |||
|
|||
(* CR lmaurer: Maybe we should similarly have a type [canonical] isomorphic | |||
to [Simple.t]? *) |
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 honestly think it would be a nice thing to document this file a bit more. Right now it's hard to understand what [canonical] and [coercion] means in this context. Both terms are used extensively but are never introduced properly. It would also be good to explain the link between coercions and rec_info.
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.
Added a few (long) comments. There isn't really yet a link between coercions and rec_info, and even once the rec_info patch is in, the connection will simply be that changing rec_info is a variety of coercion (that just happens to be currently the only nontrivial one).
Also return Bottom from more places (generally anything involved in a meet).
b851101
to
9816841
Compare
A `Name.Set.t` or `'a Name.Map.t` is a fine thing, but a `Simple.Set.t` or `'a Simple.Map.t` is much sketchier, since whether we want to treat two simples that differ only in `Rec_info.t` as equivalent depends on context. Fortunately, we usually just need a set or map of names. The one place where this gets tricky is in the uses of `Aliases.get_alias`, so there's now `Aliases.Alias_set.t` to encapsulate the needed operations.
Everything is now gone except for a few stragglers in `cmx/` and `naming/`; these will be more easily dealt with after some changes to `Simple.t`.
request-checks: true
This is xclerc's work; making a PR to review it.
Add the Coercion constructor for simple expressions. So far, only the identity coercion exists, but part 2 of this line of work will add coercions that express that two bindings might refer to the same function but at different recursion depths (which we'll be tracking in the type).