<div dir="ltr">I figured out to go for the easy way, not to figure out all the (fancy?) language pragma's. I will just rewrite the broken bits. Not hard to do, mostly annoying and less concise. <div>I use stack to build. That way I know exactly the versions that will be used for each and every dependency. </div><div><br></div><div>Thanks for helping out!</div><div>Han.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Op di 9 apr 2024 om 15:01 schreef Tom Ellis <<a href="mailto:tom-lists-haskell-cafe-2023@jaguarpaw.co.uk">tom-lists-haskell-cafe-2023@jaguarpaw.co.uk</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">By the way, how are you compiling this? I tried<br>
<br>
$ cabal build -w ghc-9.6<br>
<br>
on branch upgrade-ghc but I get a cabal resolver error.<br>
<br>
Tom<br>
<br>
<br>
On Tue, Apr 09, 2024 at 01:17:47PM +0100, Tom Ellis wrote:<br>
> I see, thanks. So it does look like my wild guess was correct. GHC<br>
> will no longer disambiguate ambiguous field selectors. Perhaps you're<br>
> supposed to use OverloadedRecordDot for this (I'm not sure, I don't<br>
> use it myself).<br>
> <br>
> On Tue, Apr 09, 2024 at 01:57:48PM +0200, Han Joosten wrote:<br>
> > The code can be found here:<br>
> > <a href="https://github.com/AmpersandTarski/Ampersand/blob/upgrade-ghc/src/Ampersand/Core/ParseTree.hs" rel="noreferrer" target="_blank">https://github.com/AmpersandTarski/Ampersand/blob/upgrade-ghc/src/Ampersand/Core/ParseTree.hs</a><br>
> > <br>
> > The idea is that I have several data definitions each with a field named<br>
> > `pos`. I have a class that conveniently gets that field from whatever<br>
> > instance. This used to work, but now is broken:<br>
> > <br>
> > data Foo = Foo<br>
> > { pos :: !Origin,<br>
> > ... other fields<br>
> > }<br>
> > data Bar = Bar<br>
> > { pos :: !Origin,<br>
> > ... other fields<br>
> > }<br>
> > <br>
> > class Traced a where<br>
> > origin :: a -> Origin<br>
> > <br>
> > instance Traced Foo where<br>
> > origin = pos<br>
> > <br>
> > instance Traced Bar where<br>
> > origin = pos<br>
> > <br>
> > Of course I could rewrite the instance definitions something like<br>
> > <br>
> > instance Traced Foo where<br>
> > origin (Foo{pos = p} = p<br>
> > <br>
> > Op di 9 apr 2024 om 12:38 schreef Tom Ellis <<br>
> > <a href="mailto:tom-lists-haskell-cafe-2023@jaguarpaw.co.uk" target="_blank">tom-lists-haskell-cafe-2023@jaguarpaw.co.uk</a>>:<br>
> > > Would it be possible to produce a minimal example that demonstrates<br>
> > > the problem? Or at the very least share the code? It's very hard to<br>
> > > know where to start diagnosing. (Although perhaps someone else knows<br>
> > > without having to see code.)<br>
> > ><br>
> > > At a wild guess, have you been hit by this?<br>
> > ><br>
> > > > As of GHC 9.4.1, selector names have to be entirely unambiguous<br>
> > > > (under the usual name resolution rules), while for record updates,<br>
> > > > there must be at most one datatype that has all the field names<br>
> > > > being updated.<br>
> > ><br>
> > > <a href="https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/duplicate_record_fields.html#extension-DuplicateRecordFields" rel="noreferrer" target="_blank">https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/duplicate_record_fields.html#extension-DuplicateRecordFields</a><br>
> > ><br>
> > > On Tue, Apr 09, 2024 at 12:18:14PM +0200, Han Joosten wrote:<br>
> > > > Hi all,<br>
> > > ><br>
> > > > I am currently migrating a Haskell project that uses ghc 8.10.7 to ghc<br>
> > > > 9.6.4.<br>
> > > ><br>
> > > > Using the new version, I get errors like<br>
> > > ><br>
> > > > ~~~.haskell<br>
> > > > Ambiguous occurrence ‘pos’<br>
> > > > It could refer to<br>
> > > > either the field ‘pos’ of record ‘PClassify’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:1265:5<br>
> > > > or the field ‘pos’ of record ‘PPurpose’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:1186:5<br>
> > > > or the field ‘pos’ of record ‘P_ViewSegment’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:1129:5<br>
> > > > or the field ‘pos’ of record ‘P_ViewD’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:1080:5<br>
> > > > or the field ‘pos’ of record ‘P_IdentDf’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:1024:5<br>
> > > > or the field ‘pos’ of record ‘P_BoxItem’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:981:9<br>
> > > > or the field ‘pos’ of record ‘TemplateKeyValue’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:959:5<br>
> > > > or the field ‘pos’ of record ‘BoxHeader’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:947:5<br>
> > > > or the field ‘pos’ of record ‘P_SubIfc’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:934:9<br>
> > > > or the field ‘pos’ of record ‘P_Interface’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:899:5<br>
> > > > or the field ‘pos’ of record ‘P_Population’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:870:9<br>
> > > > or the field ‘pos’ of record ‘P_Rule’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:806:5<br>
> > > > or the field ‘pos’ of record ‘PairViewSegment’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:740:9<br>
> > > > or the field ‘pos’ of record ‘P_NamedRel’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:591:5<br>
> > > > or the field ‘pos’ of record ‘PAtomPair’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:467:5<br>
> > > > or the field ‘pos’ of record ‘Pragma’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:415:5<br>
> > > > or the field ‘pos’ of record ‘P_Relation’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:408:5<br>
> > > > or the field ‘pos’ of record ‘Representation’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:339:5<br>
> > > > or the field ‘pos’ of record ‘PConceptDef’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:268:5<br>
> > > > or the field ‘pos’ of record ‘P_Pattern’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:209:5<br>
> > > > or the field ‘pos’ of record ‘Role’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:185:5<br>
> > > > or the field ‘pos’ of record ‘P_RoleRule’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:172:5<br>
> > > > or the field ‘pos’ of record ‘P_Enforce’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:152:5<br>
> > > > or the field ‘pos’ of record ‘MetaData’,<br>
> > > > defined at<br>
> > > > /workspaces/AmpersandNamespace/src/Ampersand/Core/ParseTree.hs:136:5<br>
> > > ><br>
> > > > Previously, it was totally fine to have different data types each have a<br>
> > > > field with the same name, as long as you used `DuplicateRecordFields`<br>
> > > ><br>
> > > > I have searched the migration documentation but I couldn't find any clue<br>
> > > on<br>
> > > > why this has been changed or how to deal with it. I probably missed it.<br>
> > > > Any help is mostly appreciated!<br>
> > > ><br>
> > > > Thanks for reading<br>
> > > > Cheers,<br>
> > > > Han Joosten<br>
> > ><br>
> > > > _______________________________________________<br>
> > > > Haskell-Cafe mailing list<br>
> > > > To (un)subscribe, modify options or view archives go to:<br>
> > > > <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
> > > > Only members subscribed via the mailman list are allowed to post.<br>
> > ><br>
> > > _______________________________________________<br>
> > > Haskell-Cafe mailing list<br>
> > > To (un)subscribe, modify options or view archives go to:<br>
> > > <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
> > > Only members subscribed via the mailman list are allowed to post.<br>
> <br>
> > _______________________________________________<br>
> > Haskell-Cafe mailing list<br>
> > To (un)subscribe, modify options or view archives go to:<br>
> > <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
> > Only members subscribed via the mailman list are allowed to post.<br>
> <br>
> _______________________________________________<br>
> Haskell-Cafe mailing list<br>
> To (un)subscribe, modify options or view archives go to:<br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
> Only members subscribed via the mailman list are allowed to post.<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>