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

Refine type reduction in adapters #144

Open
joshsh opened this issue Feb 5, 2025 · 0 comments
Open

Refine type reduction in adapters #144

joshsh opened this issue Feb 5, 2025 · 0 comments
Assignees

Comments

@joshsh
Copy link
Collaborator

joshsh commented Feb 5, 2025

At some point in the type and term adapters, type applications need to be reduced. E.g. if we have a type like Pair a = (a, a) and we are adapting a type Pair @ bigfloat, by the time we need to adapt terms like (42.0, 42.0), we need the reduced type (bigfloat, bigfloat). However, we don't want to reduce too early, as that will give us bloated type signatures in generated code. Delayed reduction solves that problem, but it fails when the argument type actually needs to be adapted: we end up with (float64, float64) (assuming bigfloat is not supported in the target language, but float64 is), whereas we want Pair float64 in the type signature.

For some reason, this problem didn't become obvious until recently, but it is cropping up in connection with the JSON decoding module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant