<div dir="ltr"><div>Hello,</div><div><br></div><div>What are the intended invariants of Unique values?</div><div>So far I thought that it is always gives a unique identity to things during a whole GHC invocation. However this is not true. I.e. eta expansion breaks this assumption.</div><div><br></div><div>Here is a snippet from the STG IR of GHC.PrimopWrappers:<br><div style="margin-left:40px"><span style="font-family:monospace">extendInt8# [InlPrag=NOINLINE] :: Int8# -> Int#</span><br><span style="font-family:monospace">[GblId, Arity=1, Unf=OtherCon []] =</span><br><span style="font-family:monospace">    \r [eta_B1] extendInt8# [eta_B1];</span><br><span style="font-family:monospace"></span><br><span style="font-family:monospace">ord# [InlPrag=NOINLINE] :: Char# -> Int#</span><br><span style="font-family:monospace">[GblId, Arity=1, Unf=OtherCon []] =</span><br><span style="font-family:monospace">    \r [eta_B1] ord# [eta_B1];</span></div><br></div><div>Where eta_B1 is redefined, so it is only unique in the scope.</div><div>Is this intentional?</div><div><br></div><div>Thanks,</div><div>Csaba Hruska<br></div></div>