i have this MRE Haskell Playground is there some way to make this code compile? i have no idea how to say to GHC i want to update the A type. searching yields only the GHC user guide and this stackoverflow question https://stackoverflow.com/questions/47854019/disambiguate-record-update-with-duplicaterecordfields
With RecordWildCards you could use case myA of MkA {..} -> MkA {c = 13, ..}, but I agree this is not ideal.
It might be cool if you would just be able to write MkA {c = 13, ..myA} to copy all the fields from myA into the new record.
Or
main = do
print $ let MkA {..} = myA in MkA {c = 13, ..}
Also to note that while the syntax is awful, it does properly communicate that a whole new piece of data is allocated instead of some in-place modification. So I would prefer it if we had some syntax like
MkA { c = 13, .. = myA }
You can add an extra annotation to myA, i.e. rewriting that one line to print $ (myA :: A) {c = 13}. Then you get a warning which you can safely ignore with {-# OPTIONS_GHC -Wno-ambiguous-fields #-}. And then some day, you’ll be able to add {-# LANGUAGE OverloadedRecordUpdate #-} and remove the annotation.