-
Notifications
You must be signed in to change notification settings - Fork 37
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
Add error for overloaded Haskell constructors #328
Conversation
…nd refuse to generate the relevant haskell code
Yes, we have discussed this limitation before, and then we came to the conclusion that the best way to have some shared state would be to use an However, for this issue the solution you propose also seems like a reasonable approach. |
src/Main.hs
Outdated
@@ -71,7 +71,7 @@ backend = Backend' | |||
, preCompile = checkConfig | |||
, postCompile = \ _ _ _ -> return () | |||
, preModule = moduleSetup | |||
, postModule = writeModule | |||
, postModule = \opts env isM m out -> verifyOutput opts env isM m out >> writeModule opts env isM m out |
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.
Maybe you could just make verifyOutput
a part of writeModule
, or else add a new function that does these two functions in sequence?
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 think a new function is probably best. Having writeModule
, in Render
, also do final verification feels like a weird mixup of concerns
The test suite fails on the following:
Please run |
I was looking for a |
Solves #125.
Unfortunately, it seems the Agda compiler only does its compiler magic for each definition independently, so there is no state carried over as to the previous definitions that have been compiled.
We check all the constructors generated for duplicates prior to
writeOutput
inpostCompile
and refuse to continue if there are duplicates. This does also add scaffolding for future post-compilation, pre-render verification steps.