Skip to content

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