<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Dear Simon,</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB"><div class="m_6892644899177656503gmail-m_-7864807052939795967WordSection1"><span class="m_6892644899177656503gmail-"><p class="MsoNormal"></p>
<p class="MsoNormal" style="margin-left:36pt"><span style="font-size:12pt;font-family:Arial,sans-serif;color:rgb(34,34,34);background:white">If we require at least one mutable field for a constructor to have physical equality, then reallyUnsafePtrEq# can be
 avoided both in derived or handwritten equality functions</span><span style="font-size:12pt"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
</span><p class="MsoNormal"><span style="font-size:12pt">Well, of course you need at least one mutable field!  But having got it, how do we get rid of the unsafe-ptr-eq? </span></p></div></div></blockquote><div><br></div><div>FYI, the proposal as written now also allows constructors with no mutable fields but still offering O(1) physical identity:</div><div><br></div><div><font face="monospace, monospace">  data T where MkT :: [Int] -> IO T</font></div><div><font face="monospace, monospace">    deriving Eq</font></div><div><br></div><div>But if this is disallowed, and we have <i>at least one</i> mutable field...</div><div><br></div><div><span style="color:rgb(34,34,34);font-family:monospace,monospace;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">  data T where MkT :: mutable [Int] -> IO T</span><br></div><div><br></div><div>Then the simple observation is that we no longer need to use reallyUnsafePtrEq on two MkT constructors themselves, rather we can simply use Ref# equality on any pair of matching fields:</div><div><br></div><div><font face="monospace, monospace">  eq (MkT a) (MkT b) = refEq a b</font></div><div><br></div><div>Ref# equality is just a one-word pointer comparison of course, but unlike <span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">reallyUnsafePtrEq, it's always safe.</span></div><div> <br></div><div><blockquote class="gmail_quote" style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB"><div class="m_6892644899177656503gmail-m_-7864807052939795967WordSection1"><p class="MsoNormal" style="margin:0px"><span style="font-size:12pt">Perhaps the thing to do is to update the proposal to whatever the new idea is?</span></p></div></div></blockquote><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial">Yes, indeed!  Let's.  </div></div><div><br></div><div>Best,</div><div>  -Ryan</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div lang="EN-GB"><div class="m_6892644899177656503gmail-m_-7864807052939795967WordSection1"><p class="MsoNormal"><span style="font-size:12pt"> </span></p>
<p class="MsoNormal"><span style="font-size:12pt">Simon<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:12pt"><u></u> <u></u></span></p>
<div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0cm 0cm 0cm 4pt">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> Ryan Newton [mailto:<a href="mailto:rrnewton@indiana.edu" target="_blank">rrnewton@indiana.edu</a>]
<br>
<b>Sent:</b> 03 March 2018 23:14<br>
<b>To:</b> Simon Marlow <<a href="mailto:marlowsd@gmail.com" target="_blank">marlowsd@gmail.com</a>>; Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>><br>
<b>Cc:</b> Joachim Breitner <<a href="mailto:mail@joachim-breitner.de" target="_blank">mail@joachim-breitner.de</a>>; <a href="mailto:ghc-steering-committee@haskell.org" target="_blank">ghc-steering-committee@haskell<wbr>.org</a><br>
<b>Subject:</b> Re: [ghc-steering-committee] Please review: Mutable constructor fields, Shepherd: Ryan Newton<u></u><u></u></span></p>
</div>
</div><div><div class="m_6892644899177656503gmail-h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
I'm certainly fine with going back to discussion.<u></u><u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
Simon PJ, much of your review was improvements/edits, and after those are incorporated, which are the highest priority, deal-breaker issues for you?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
In particular, the requirement to use <span style="font-size:12pt;font-family:"Courier New";color:rgb(34,34,34);background:white">reallyUnsafePtrEq#</span><span style="font-size:12pt;font-family:Arial,sans-serif;color:rgb(34,34,34);background:white"> received some
 subsequent discussion.  If we require at least one mutable field for a constructor to have physical equality, then reallyUnsafePtrEq# can be avoided both in derived or handwritten equality functions.  Does that improve your assessment?</span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
Best,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
 -Ryan<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
On Thu, Mar 1, 2018 at 3:48 AM, Simon Marlow <<a href="mailto:marlowsd@gmail.com" target="_blank">marlowsd@gmail.com</a>> wrote:<u></u><u></u></p>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12pt;margin-left:0cm">
Simon has provided a detailed review (thanks!) so I think we'll need some time to digest those comments and suggestions and modify the proposal. In light of that shall we put the proposal back into the discussion phase for now?<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
Cheers<u></u><u></u></p>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<span class="m_6892644899177656503gmail-m_-7864807052939795967m-4105705293107782186hoenzb"><span style="color:rgb(136,136,136)">Simon</span></span><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
On 1 March 2018 at 05:17, Joachim Breitner <<a href="mailto:mail@joachim-breitner.de" target="_blank">mail@joachim-breitner.de</a>> wrote:<u></u><u></u></p>
</div>
</div>
<blockquote style="border-top:none;border-right:none;border-bottom:none;border-left:1pt solid rgb(204,204,204);padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12pt;margin-left:0cm">
Hi,<br>
<br>
Am Freitag, den 23.02.2018, 15:22 -0500 schrieb Ryan Newton:<br>
> Ok, I'm not hearing any strong objections and over the long course of<br>
> discussion in various venues, reactions have been mostly positive.<br>
> Since committee discussion here has died down, I move to go ahead and<br>
> accept this proposal if there are no further objections.<br>
<br>
it has been quiet here, but I see new activity on<br>
<a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fghc-proposals%2Fghc-proposals%2Fpull%2F8&data=04%7C01%7Csimonpj%40microsoft.com%7C0fbe8d22dcbd49db82bd08d5815c8c66%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636557156850040805%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=0V4RHBIaGCfrcdDceNHqqgME11gjUc7o78vGYO2Xfog%3D&reserved=0" target="_blank">https://github.com/ghc-proposa<wbr>ls/ghc-proposals/pull/8</a><br>
<br>
Is this a sign that the proposal is not yet as polished as would hope<br>
for?<br>
<span style="color:rgb(136,136,136)"><br>
<span class="m_6892644899177656503gmail-m_-7864807052939795967m-4105705293107782186m5087147037525946760hoenzb">Joachim</span><br>
<br>
<span class="m_6892644899177656503gmail-m_-7864807052939795967m-4105705293107782186m5087147037525946760hoenzb">--</span><br>
<span class="m_6892644899177656503gmail-m_-7864807052939795967m-4105705293107782186m5087147037525946760hoenzb">Joachim “nomeata” Breitner</span><br>
<span class="m_6892644899177656503gmail-m_-7864807052939795967m-4105705293107782186m5087147037525946760hoenzb">  <a href="mailto:mail@joachim-breitner.de" target="_blank">
mail@joachim-breitner.de</a></span><br>
<span class="m_6892644899177656503gmail-m_-7864807052939795967m-4105705293107782186m5087147037525946760hoenzb">  <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.joachim-breitner.de%2F&data=04%7C01%7Csimonpj%40microsoft.com%7C0fbe8d22dcbd49db82bd08d5815c8c66%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636557156850040805%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwifQ%3D%3D%7C-1&sdata=q60KMAI7yEupX4KCbr0xqXNcxEeiNqfh6OdyoMLZJEA%3D&reserved=0" target="_blank">
https://www.joachim-breitner.d<wbr>e/</a></span></span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12pt;margin-left:0cm">
______________________________<wbr>_________________<br>
ghc-steering-committee mailing list<br>
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank">ghc-steering-committee@haskell<wbr>.org</a><br>
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" target="_blank">https://mail.haskell.org/cgi-b<wbr>in/mailman/listinfo/ghc-steeri<wbr>ng-committee</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:12pt;margin-left:0cm">
<br>
______________________________<wbr>_________________<br>
ghc-steering-committee mailing list<br>
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank">ghc-steering-committee@haskell<wbr>.org</a><br>
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" target="_blank">https://mail.haskell.org/cgi-b<wbr>in/mailman/listinfo/ghc-steeri<wbr>ng-committee</a><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
</div>
</div></div></div>
</div>
</div>

</blockquote></div><br></div></div>