<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Aug 21, 2018, 3:39 AM Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank" rel="noreferrer">simonpj@microsoft.com</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Actually I'm confused.  Currently we have<br>
<br>
data StableName a = StableName (StableName# a)<br>
<br>
I believe (but there is no documentation to state) that the (StableName# a) <br>
 * Has kind (TYPE UnliftedRep)<br>
 * Is the index of the entry in the Stable Name Table<br>
<br>
But if it's the index, why isn't it an IntRep?  UnliftedRep is for pointers?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">That's explained in the paper. A StableName# is a pointer to a stable name object in the heap that *contains* an index into the stable name table. Basically, the garbage collector needs to know whether a stable name is alive or not, so it can work out when to clear it from the table.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Moreover eqStableName# :: StableName# a -> StableName# b -> Bool<br>
is directly implemented in the code generator (StgCmmPrim) by an equality<br>
comparison.<br>
<br>
If these things are correct, it would be great to write them down in a Note.<br>
<br>
And if they are right, I'm now lost about what you question is.  Equality is<br>
/already/ implemented by direct equality comparison, no?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">It's currently implemented by an equality test on the indices stored in the stable name objects, rather than the pointers to those objects, if I'm not very much mistaken.</div></div>