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

Erased data and record types and modules #6294

Merged
merged 8 commits into from
Dec 7, 2022
Merged

Erased data and record types and modules #6294

merged 8 commits into from
Dec 7, 2022

Conversation

nad
Copy link
Contributor

@nad nad commented Nov 4, 2022

See issue #4743.

I also addressed issue #6271: If a constructor is erased, then the corresponding generated definitions are also erased. However, I don't know if this is correct.

I have not modified the double-checker, and I don't know if that is necessary. (Is the double-checker still maintained?)

@nad nad requested a review from jespercockx November 4, 2022 22:59
@nad nad self-assigned this Nov 4, 2022
@nad nad added this to the 2.6.4 milestone Nov 4, 2022
@nad nad marked this pull request as draft November 5, 2022 15:40
@nad nad force-pushed the issue4743 branch 2 times, most recently from 7993a7b to 656eff9 Compare November 5, 2022 19:45
@nad
Copy link
Contributor Author

nad commented Nov 5, 2022

I have not modified the double-checker, and I don't know if that is necessary. (Is the double-checker still maintained?)

The double-checker does not seem to care too much about erasure, so I don't plan to include any changes to it in this pull request.

@nad
Copy link
Contributor Author

nad commented Nov 6, 2022

The pull request includes the following text in doc/user-manual/language/runtime-irrelevance.lagda.rst (see #6292):

TODO: Explain how the reflection machinery interacts with run-time
irrelevance.

@nad nad marked this pull request as ready for review November 6, 2022 11:15
Copy link
Member

@jespercockx jespercockx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks great to me. Two small remarks:

  • The double checker is maintained but is currently too liberal regarding modalities, this should be fixed but not as part of this PR.
  • Regarding reflection, I recently added the ability to run erased macros (see Allow running of erased macros #5744). I'm not sure what else we should mention regarding the interaction between erasure and reflection.

@nad
Copy link
Contributor Author

nad commented Nov 28, 2022

  • Regarding reflection, I recently added the ability to run erased macros (see Allow running of erased macros #5744). I'm not sure what else we should mention regarding the interaction between erasure and reflection.

The manual contains an incomplete explanation of when Agda switches between compile-time and run-time mode. Switches performed by the reflection machinery are omitted, and should be included.

nad added 8 commits December 7, 2022 15:04
The field envModality was removed in favour of envRelevance and
envQuantity, because (according to some comment) cohesion shouldn't be
in the environment. The LensModality instance for TCEnv and the lens
eModality were also removed.

Furthermore the LensRelevance and LensQuantity instances for TCEnv
were removed. Now every change of the environment's relevance
component is performed using the lens eRelevance, and every change of
the environment's quantity component is performed using eQuantity.
Furthermore applyQuantityToJudgementOnly was renamed to
applyQuantityToJudgement and generalised.
When the hard compile-time mode is used all constants that are added
to the signature are made erased. The hard compile-time mode is
entered when an erased definition is checked, but not when a
type-signature is checked.

This is related to issue #6271: When an erased constructor is
type-checked the hard compile-time mode is entered, and all associated
definitions become erased.
@nad
Copy link
Contributor Author

nad commented Dec 7, 2022

I also addressed issue #6271: If a constructor is erased, then the corresponding generated definitions are also erased. However, I don't know if this is correct.

@plt-amy thinks that it is.

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.

Cubical: should generated code corresponding to erased constructors be erased?
2 participants