Note [Deterministic ApplicativeDo and RecursiveDo desugaring]
Both ApplicativeDo and RecursiveDo need to create tuples not present in the source text. For ApplicativeDo we create: (a,b,c) <- (\c b a -> (a,b,c)) <$> For RecursiveDo we create: mfix (\ ~(a,b,c) -> do ...; return (a',b',c')) The order of the components in those tuples needs to be stable across recompilations, otherwise they can get optimized differently and we end up with incompatible binaries. To get a stable order we use nameSetElemsStable. See Note [Deterministic UniqFM] to learn more about nondeterminism.
References 1
- Deterministic UniqFM GHC.Types.Unique.DFM
Referenced by 4
- GHC.Rename.Expr call site ×4