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

Principled subst determination with re-exported Dict module #24

Open
zliu41 opened this issue Feb 24, 2022 · 1 comment
Open

Principled subst determination with re-exported Dict module #24

zliu41 opened this issue Feb 24, 2022 · 1 comment

Comments

@zliu41
Copy link
Member

zliu41 commented Feb 24, 2022

substituting let variables need some analysis on the nature of the target expressions. Especially, if the expression is Dict type, then we need to have special cares. Unfortunately, Dict can come from different modules from re-export and there are no easy ways to check the equality of those definitions. So in 15465, we have hard-coded two modules Data.Constraint and Barbies.Internal,Dicts, but some other cases may happen in the future, so this should be handled correctly.This may require some change in the ordering of our categorization steps and further module export analysis. So we want to postpone the work until when the approach becomes more clear.

AC:

No more hard-coded re-exported module check in isDictOrBarbiesDictTyCon but detecting such re-export in general way.

(Extricated from https://kitty-hawk.atlassian.net/browse/SW-3418)

@sellout
Copy link
Member

sellout commented May 26, 2022

Would it be possible to somehow apply Client.Rep and check that type? Barbies.Dict (and any other Dict-like that appears) should have Constraint.Dict as its Rep.

Also, point of clarity – Barbies.Dict isn't a re-export. They're different, roughly

ConstraintDict :: a => ConstraintDict a
BarbiesDict :: c a => BarbiesDict c a

An actual re-export should be trivially seen as Constraint.Dict.

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

No branches or pull requests

2 participants