
Hey Cafe, With the advent of RecordDotSyntax (or more precisely OverloadedRecordDot?) in 9.2, I was expecting this wart to be fixed: data Ty = X {x :: String} | Y {y :: Int}
y $ X "lol" *** Exception: No match in record selector y
As it seems like the perfect opportunity to introduce a breaking change for a behaviour that is usually undesirable (in my experience). But instead:
:set -XOverloadedRecordDot (X "lol").y *** Exception: No match in record selector y
Unfortunately, I couldn't follow and/or remember all of the discussion around RecordDotSyntax, so this might be something I missed. Is there a reason why we don't generate HasField x r a only when all of the constructors for r have a field "x" :: a? If not, is the community open to changing this, while the new extension is still ripe? Cheers! ======= Georgi

On Fri, Nov 19, 2021 at 11:24:39AM +0200, Georgi Lyubenov wrote:
Is there a reason why we don't generate HasField x r a only when all of the constructors for r have a field "x" :: a? If not, is the community open to changing this, while the new extension is still ripe?
Let's change it please! Partial record fields are a massive wart which we shouldn't perpetuate into related features.

I also made a discussion on the ghc-proposals discussions page, since it seemed like an appropriate place for this kind of thing - https://github.com/ghc-proposals/ghc-proposals/discussions/459 On Fri, Nov 19, 2021 at 11:59 AM Tom Ellis < tom-lists-haskell-cafe-2017@jaguarpaw.co.uk> wrote:
Is there a reason why we don't generate HasField x r a only when all of
On Fri, Nov 19, 2021 at 11:24:39AM +0200, Georgi Lyubenov wrote: the
constructors for r have a field "x" :: a? If not, is the community open to changing this, while the new extension is still ripe?
Let's change it please! Partial record fields are a massive wart which we shouldn't perpetuate into related features. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
participants (2)
-
Georgi Lyubenov
-
Tom Ellis