I'm using lots of different records in a program, with some of them using the same field names, e.g.
data Customer = Customer { ..., foo :: Int, ... }
data Product = Product { ..., foo :: Int, ... }
Now as the accessor function "foo" is defined twice, I get the "Multiple declarations" error. One way to avoid this would be using different modules that are imported fully qualified, or simply renaming the fields (which I don't want to do).
What is the officially suggested way of dealing with this in Haskell?
OverloadedRecordFields
extension for GHC to allow multiple record datatypes to share the same field names. – Dolli