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

Only compile Agda instances to a Haskell instance if they target a Haskell class #284

Merged
merged 6 commits into from
Feb 23, 2024

Conversation

jespercockx
Copy link
Member

This is a little gift for @jakobn-ai , who asked in #270 (comment) if we could have instances on the Agda side that compile to regular functions in Haskell. I thought this should be easy since we can just check whether a given instance actually targets a type that is compiled to a Haskell class, and it turns out I was right :)

@jespercockx jespercockx requested a review from flupe February 21, 2024 16:53
@jespercockx
Copy link
Member Author

The second commit implements the same logic but for instance arguments: if the type of an argument is not compiled to a class in Haskell, then we compile it to a regular argument instead.

Copy link
Contributor

@flupe flupe left a comment

Choose a reason for hiding this comment

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

Very nice!

I think it closes #218, perhaps even #251.

src/Agda2Hs/Compile.hs Outdated Show resolved Hide resolved
src/Agda2Hs/Compile/Term.hs Show resolved Hide resolved
src/Agda2Hs/Compile/Utils.hs Show resolved Hide resolved
src/Agda2Hs/Compile/Utils.hs Show resolved Hide resolved
@jespercockx jespercockx added this to the 1.3 milestone Feb 23, 2024
@jespercockx jespercockx merged commit 4ed1d56 into agda:master Feb 23, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants