Use `Infinite` in unique generation, and clean up some other partial uni patterns as well.
Also drop the losing `instance MonadFail UniqSM`. We redefine `getUniquesM` in terms of `Infinite` rather than `[]`, and define another method `getUniqueListM` for the use sites where we actually want a `[]`. Thus, at many sites, we can avoid the partiality of the empty list case. We also define `withUniques`, `withUniquesM`, and `withUniquesM'`, which traverse an arbitrary `Traversable` structure and introduce a `Unique` for each element. This allows us to redefine various functions to operate on more appropriate types than `[]` and avoid further partiality (in the form of incomplete-uni-patterns).
Showing
- compiler/GHC/Cmm/ThreadSanitizer.hs 2 additions, 2 deletionscompiler/GHC/Cmm/ThreadSanitizer.hs
- compiler/GHC/CmmToAsm/AArch64/CodeGen.hs 37 additions, 31 deletionscompiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- compiler/GHC/Core/Opt/SetLevels.hs 45 additions, 34 deletionscompiler/GHC/Core/Opt/SetLevels.hs
- compiler/GHC/Core/Opt/Simplify/Utils.hs 2 additions, 2 deletionscompiler/GHC/Core/Opt/Simplify/Utils.hs
- compiler/GHC/Core/Opt/WorkWrap/Utils.hs 2 additions, 2 deletionscompiler/GHC/Core/Opt/WorkWrap/Utils.hs
- compiler/GHC/Core/Subst.hs 13 additions, 8 deletionscompiler/GHC/Core/Subst.hs
- compiler/GHC/Iface/Env.hs 3 additions, 5 deletionscompiler/GHC/Iface/Env.hs
- compiler/GHC/IfaceToCore.hs 1 addition, 1 deletioncompiler/GHC/IfaceToCore.hs
- compiler/GHC/Runtime/Eval.hs 1 addition, 1 deletioncompiler/GHC/Runtime/Eval.hs
- compiler/GHC/Stg/Unarise.hs 6 additions, 3 deletionscompiler/GHC/Stg/Unarise.hs
- compiler/GHC/Tc/Gen/HsType.hs 1 addition, 1 deletioncompiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Utils/Monad.hs 3 additions, 5 deletionscompiler/GHC/Tc/Utils/Monad.hs
- compiler/GHC/Types/Id.hs 7 additions, 3 deletionscompiler/GHC/Types/Id.hs
- compiler/GHC/Types/Unique/Supply.hs 33 additions, 14 deletionscompiler/GHC/Types/Unique/Supply.hs
Loading
Please register or sign in to comment