<div dir="ltr">Also worth remembering here is that ghc will often unpack such things if it can determine it can do so (but only with optimization iirc), so there is no guarantee that the two will be representationally equivalent even without pragmas.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Feb 25, 2019 at 10:17 AM Oleg Grenrus <<a href="mailto:oleg.grenrus@iki.fi">oleg.grenrus@iki.fi</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="auto"><div><div style="direction:inherit"><span style="background-color:rgba(255,255,255,0)">Two data types are `Coercible` (as in Data.Coerce) if their representation in memory is the same: they are representiationally equivalent You ask for looser structural isomorphism, consider e.g. </span></div><div style="direction:inherit"><span style="background-color:rgba(255,255,255,0)"><br></span></div><div style="direction:inherit"><span style="background-color:rgba(255,255,255,0)">    data B b = B {-# UNPACK #-} !Int b</span></div><div style="direction:inherit"><span style="background-color:rgba(255,255,255,0)"><br></span></div><div style="direction:inherit">and</div><div style="direction:inherit"><br></div><div style="direction:inherit">    (Int, b)</div><div style="direction:inherit"><br></div><div style="direction:inherit">The values of these types have quite different representation/memory layout.</div><div style="direction:inherit"><br></div><div style="direction:inherit">- Oleg</div></div><div><br>On 25 Feb 2019, at 16.38, Georgi Lyubenov <<a href="mailto:godzbanebane@gmail.com" target="_blank">godzbanebane@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">Greetings!<br><br>Is there any reason behind/what is the reason behind<br>```<br>data A a b = A a b<br>```<br>and<br>```<br>(a, b)<br>```<br><br>not being coercible?<br><br>And in general all n-ary constructors not being coercible to one another?<br><br>Thanks in advance!<div><br>=======<br>Georgi</div></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Haskell-Cafe mailing list</span><br><span>To (un)subscribe, modify options or view archives go to:</span><br><span><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a></span><br><span>Only members subscribed via the mailman list are allowed to post.</span></div></blockquote></div>_______________________________________________<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><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>brandon s allbery kf8nh</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a></div></div></div></div></div>