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

Adding "type" prefix before type operator imports #194

Merged
merged 8 commits into from
Jul 27, 2023

Conversation

viktorcsimma
Copy link
Contributor

@viktorcsimma viktorcsimma commented Jul 24, 2023

GHC expects that when importing type operators, the type prefix is provided before the identifier in the import specs. This PR fixes that. It only calculates this for operators; since for other identifiers it would only be needed when having a "normal" function with the same name, and Agda doesn't allow that.

Unfortunately, when type operators have "children" imports (see (***) in TypeOperatorImport.hs), you have to specify it too, but the Haskell Language Extensions' pretty printer does not do it. So I had to circumvent this; which has the side effect of it not being able to break long import lines anymore. (But see PR 475 there.)

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.

Thank you for the PR! I have two comments, but overall this seems like a useful improvement to have.

src/Agda2Hs/Compile/Imports.hs Outdated Show resolved Hide resolved
src/Agda2Hs/Compile/Name.hs Outdated Show resolved Hide resolved
@jespercockx jespercockx merged commit 4a6ea21 into agda:master Jul 27, 2023
@jespercockx jespercockx added this to the 1.1 milestone Oct 12, 2023
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.

2 participants