<div dir="ltr"><div>I said (<a href="https://mail.haskell.org/pipermail/haskell-cafe/2024-December/136986.html">https://mail.haskell.org/pipermail/haskell-cafe/2024-December/136986.html</a>)</div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, 25 Dec 2024 at 16:49, Anthony Clayden <<a href="mailto:anthony.d.clayden@gmail.com">anthony.d.clayden@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>...</div><div><br></div><div><div>[**] I'm particularly keen on field names starting upper case, because they're injective/part of the structure, like data constructors.</div><div><br></div><div><br></div></div></div></blockquote><div><br></div><div>And previously with Hugs (<a href="https://mail.haskell.org/pipermail/hugs-users/2020-May/000927.html">https://mail.haskell.org/pipermail/hugs-users/2020-May/000927.html</a>)</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br class="gmail-Apple-interchange-newline"><span style="color:rgb(0,0,0);white-space:pre-wrap">* I've taught Trex to support field labels starting upper-case, because,</span></div></div></div></blockquote><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">  well for me they're more like constructors than variables.</span><br class="gmail-Apple-interchange-newline"><br></div></div></div></blockquote><div><br></div></div><div><br></div><div>So can I combine that work? Yes, providing I use Upper-case labels only within `{ ... }`. These can combine lower with Upper field names within the same data type; can pun on the lower.</div><div><br></div><div>></div><div>>     data Upup a = MkUp{ down :: a, Up :: Int }   deriving (Eq, Show)</div><div>></div><div>>     anUp  = MkUp{ down = 'a', Up = 5 }      -- build</div>>     recUp = anUp{ Up = 7 }              -- field update by Up label, record syntax</div><div class="gmail_quote gmail_quote_container">></div><div class="gmail_quote gmail_quote_container">>     succUp (MkUp {down, Up = u} ) = MkUp{ down = succ down, Up = succ u }<br><div>></div><div><br></div><div>You can't use a field selection function: 'ERROR - "Up" is not a data constructor'.</div><div>(It looks like Hugs does generate such a function; this error is a syntax rejection in trying to use it.)</div><div><br></div><div><br></div></div></div>