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

deconstructProduct does not extract fields from given product #2469

Closed
martijnbastiaan opened this issue May 17, 2023 · 1 comment
Closed
Assignees
Labels
bug patch-provided Patch provided in comments: needs review, merge, etc.

Comments

@martijnbastiaan
Copy link
Member

The implementation of deconstructProduct:

deconstructProduct (TExpr ty@(Product _ _ tys) (Identifier resName _)) vals = do
newNames <- zipWithM declare vals tys
addDeclaration $ Assignment resName Cont $ DataCon ty (DC (ty, 0)) (fmap eex newNames)
pure newNames

..does not do what it promises to at all. It should return a list of expressions representing all the fields of the given product type. It should probably also handle cases where the given expression is not a plain Identifier.

@martijnbastiaan martijnbastiaan added bug patch-provided Patch provided in comments: needs review, merge, etc. labels May 17, 2023
@martijnbastiaan martijnbastiaan self-assigned this May 17, 2023
martijnbastiaan added a commit that referenced this issue May 17, 2023
Fixes #2469

Co-authored-by: Felix Klein <felix@qbaylogic.com>
Co-authored-by: Hidde Moll <hidde@qbaylogic.com>
martijnbastiaan added a commit that referenced this issue May 17, 2023
Fixes #2469

Co-authored-by: Felix Klein <felix@qbaylogic.com>
Co-authored-by: Hidde Moll <hidde@qbaylogic.com>
@christiaanb
Copy link
Member

We've released v1.8.0, which includes a fix for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug patch-provided Patch provided in comments: needs review, merge, etc.
Projects
None yet
Development

No branches or pull requests

2 participants