Unique invariants: GHC invocation vs scope?

Csaba Hruska csaba.hruska at gmail.com
Fri May 8 13:03:03 UTC 2020


Hello,

What are the intended invariants of Unique values?
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.

Here is a snippet from the STG IR of GHC.PrimopWrappers:
extendInt8# [InlPrag=NOINLINE] :: Int8# -> Int#
[GblId, Arity=1, Unf=OtherCon []] =
    \r [eta_B1] extendInt8# [eta_B1];

ord# [InlPrag=NOINLINE] :: Char# -> Int#
[GblId, Arity=1, Unf=OtherCon []] =
    \r [eta_B1] ord# [eta_B1];

Where eta_B1 is redefined, so it is only unique in the scope.
Is this intentional?

Thanks,
Csaba Hruska
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20200508/31557f75/attachment.html>


More information about the ghc-devs mailing list