Hello folks, if you try compiling the module
{-# LANGUAGE DuplicateRecordFields #-}
module Junk where
data Foo = Foo { foo :: Int }
data Bar = Bar { foo :: Int }
blah :: Bar -> Bar
blah bar = bar { foo = 5 }
you’ll get the warning
junk.hs:10:18: warning: [GHC-02256] [-Wambiguous-fields]
Ambiguous record update with parent type constructor ‘Bar’.
This type-directed disambiguation mechanism will not be supported by -XDuplicateRecordFields in future releases of GHC.
Consider disambiguating using module qualification instead.
|
10 | blah bar = bar { foo = 5 }
| ^^^^^^
but I don’t understand the suggestion to “use module qualification instead”.