-
Notifications
You must be signed in to change notification settings - Fork 46
[ #155 ] Add COMPILE ... to pragmas for data types and functions
#430
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
Conversation
|
@J0s3c4rl0s perhaps you would be interested to give this a try for some of the examples from your thesis. |
|
Yes this sounds interesting, I could use some of the agda examples in |
914b99e to
d06d58d
Compare
d06d58d to
eda4b44
Compare
omelkonian
left a comment
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.
Looks good! Although the new feature is incomplete (cover type aliases/classes, etc.), there's no harm in merging this partial solution as it already seems very useful.
…ave the same names
eda4b44 to
97807b0
Compare
Thank you for the review. I agree that this could use more testing, but since we're not close to a release I'll just merge this so it's easier for others to test out too. |
This is a first attempt at implementing a
COMPILE ... topragma for compiling a datatype or function to an existing Haskell definition, as described in #155. Currently there are the following limitations:IORefto keep track of the mapping between names, which hopefully should not be a problem.COMPILE ... topragma, despite generating no code it still compiles both the definition in the pragma and the target definition, which is a bit wasteful. It would perhaps be more efficient to store the compiled definitions in anotherIORefso we don't need to recompile them later (there are other places in the agda2hs codebase where this would be useful too).COMPILEpragma is not yet supported.I'll probably add some more tests (including failing ones) later and perhaps add support for type aliases too, but I'm already curious to see what people think about this.