Skip to content

Conversation

isovector
Copy link
Collaborator

@isovector isovector commented Apr 15, 2021

@kcsongor requested the ability to transform:

data MyRec = MyRec {a :: Int, b :: Text, c :: Char}
deconstruct :: MyRec -> Int
deconstruct m = _

into

data MyRec = MyRec {a :: Int, b :: Text, c :: Char}
deconstruct :: MyRec -> Int
deconstruct MyRec {a, b, c} = _

This PR adds this functionality under a new code action, available only for values of records. It correctly deals with GADTS and shadowing, opting to use a generated name in the latter case.

@isovector isovector added the merge me Label to trigger pull request merge label Apr 16, 2021
@mergify mergify bot merged commit ef90289 into haskell:master Apr 16, 2021
@isovector isovector deleted the named-field-puns branch May 21, 2021 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants