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

Refactor TopEnvFrag #861

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

apaszke
Copy link
Collaborator

@apaszke apaszke commented Apr 13, 2022

TopEnvFrag was very confusing, because even though it used to carry a
ModuleEnv, many elements of that ModuleEnv (source map, synthesis candidates, ...)
would be expected to not include any imported values! I lost some time
thanks to this unstated invariant, so I figured it's a good time to
clean it up!

With this change TopEnvFrag directly mimics the structure of Env,
and includes top emissions separately from module-level emissions. And
module-level emissions are no longer represented by a ModuleEnv, but
by a ModuleEmissions ADT that explicitly states the relevant
invariants.

TopEnvFrag was very confusing, because even though it used to carry a
ModuleEnv, many elements of that ModuleEnv (source map, synthesis candidates, ...)
would be expected to not include any imported values! I lost some time
thanks to this unstated invariant, so I figured it's a good time to
clean it up!

With this change `TopEnvFrag` directly mimics the structure of `Env`,
and includes top emissions separately from module-level emissions. And
module-level emissions are no longer represented by a `ModuleEnv`, but
by a `ModuleEmissions` ADT that explicitly states the relevant
invariants.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant