I'm using the DuplicateRecordFields (+OverloadedLabels) extension, and I've run into a situation where I can't figure out how to disambiguate in a record update.
Here is a simplified example:
data A = A { name :: String }
data B = B { name :: String }
combine :: A -> B -> A
combine a b = a { name = name b }
Is there any way to make this work?
You could match the name from a pattern:
I'm not a fan of
DuplicateRecordFieldsthough. Why not instead go the lens route?