Upgrade UniqSet to a newtype
authorDavid Feuer <david.feuer@gmail.com>
Wed, 1 Mar 2017 18:47:39 +0000 (13:47 -0500)
committerDavid Feuer <David.Feuer@gmail.com>
Wed, 1 Mar 2017 18:47:41 +0000 (13:47 -0500)
commitcbe569a56e2a82bb93a008beb56869d9a6a1d047
tree4143ecfabf7b171159c2980e545fe66e0118e1f0
parent701256df88c61a2eee4cf00a59e61ef76a57b4b4
Upgrade UniqSet to a newtype

The fundamental problem with `type UniqSet = UniqFM` is that `UniqSet`
has a key invariant `UniqFM` does not. For example, `fmap` over
`UniqSet` will generally produce nonsense.

* Upgrade `UniqSet` from a type synonym to a newtype.

* Remove unused and shady `extendVarSet_C` and `addOneToUniqSet_C`.

* Use cached unique in `tyConsOfType` by replacing
  `unitNameEnv (tyConName tc) tc` with `unitUniqSet tc`.

Reviewers: austin, hvr, goldfire, simonmar, niteria, bgamari

Reviewed By: niteria

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D3146
47 files changed:
compiler/basicTypes/DataCon.hs
compiler/basicTypes/NameSet.hs
compiler/basicTypes/RdrName.hs
compiler/basicTypes/VarEnv.hs
compiler/basicTypes/VarSet.hs
compiler/cmm/PprC.hs
compiler/coreSyn/CoreFVs.hs
compiler/coreSyn/CoreSubst.hs
compiler/coreSyn/CoreSyn.hs
compiler/deSugar/DsArrows.hs
compiler/deSugar/DsUsage.hs
compiler/ghci/Debugger.hs
compiler/ghci/RtClosureInspect.hs
compiler/iface/MkIface.hs
compiler/llvmGen/LlvmCodeGen/Base.hs
compiler/nativeGen/RegAlloc/Graph/ArchBase.hs
compiler/nativeGen/RegAlloc/Graph/Main.hs
compiler/nativeGen/RegAlloc/Graph/Spill.hs
compiler/nativeGen/RegAlloc/Graph/SpillClean.hs
compiler/nativeGen/RegAlloc/Graph/SpillCost.hs
compiler/nativeGen/RegAlloc/Graph/TrivColorable.hs
compiler/nativeGen/RegAlloc/Linear/Main.hs
compiler/nativeGen/RegAlloc/Liveness.hs
compiler/rename/RnBinds.hs
compiler/rename/RnSource.hs
compiler/simplCore/OccurAnal.hs
compiler/stranal/DmdAnal.hs
compiler/typecheck/TcBinds.hs
compiler/typecheck/TcEvidence.hs
compiler/typecheck/TcExpr.hs
compiler/typecheck/TcMType.hs
compiler/typecheck/TcSMonad.hs
compiler/typecheck/TcSimplify.hs
compiler/typecheck/TcTyDecls.hs
compiler/typecheck/TcValidity.hs
compiler/types/TyCoRep.hs
compiler/types/Type.hs
compiler/types/Unify.hs
compiler/utils/GraphColor.hs
compiler/utils/GraphOps.hs
compiler/utils/GraphPpr.hs
compiler/utils/UniqDSet.hs
compiler/utils/UniqFM.hs
compiler/utils/UniqSet.hs
compiler/vectorise/Vectorise/Env.hs
compiler/vectorise/Vectorise/Type/Classify.hs
testsuite/tests/callarity/unittest/CallArity1.hs