Skip to content

deconstructProduct does not extract fields from given product #2469

Description

@martijnbastiaan

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.

Metadata

Metadata

Labels

bugpatch-providedPatch provided in comments: needs review, merge, etc.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions