Csaba Hruska <csaba.hruska@gmail.com> writes:
> Hi Ben,
>
> I thought that it is possible to rely on unique values *in case of non
> exported Ids* because they are local to a specific module and can not
> appear in expressions in other modules because they are not exported.
> Do I miss something?
>
Uniques should be treated as being non-reproducible across compiler
sessions.
To make this more concrete: if GHC compiles the same module twice it
will not necessarily assign the same uniques to the module's Names.
Uniques are derived from local UniqSupplies conjured up at a variety of
points in the compilation pipeline (search from mkSplitUniqSupply).
These supplies are themselves derived from an impure global counter (see
compiler/cbits/genSym.c). The state of this counter (and consequently
the uniques derived from it) should be treated as being entirely
unpredictable.
Cheers,
- Ben