Hi, UniqFM and UniqDFM types are basically maps from Uniques to other stuff. Most of the time we don't actually map Uniques but instead map things like Vars or Names. For those we have types like VarEnv, NameEnv, FastStringEnv, ... which are defined as type synonyms to UniqFM or UniqDFM, and operations are defined like
extendFsEnv = addToUFM extendNameEnv = addToUFM extendVarEnv = addToUFM This causes problems when I have multiple Uniquables in scope and use the wrong one to update an environment because the program type checks and does the wrong thing in runtime. An example is #17667 where I did delVarEnv env name where `name :: Name`. I shouldn't be able to remove a Name from a Var env but this currently type checks. Two solutions proposed: - Make these env types newtypes instead of type synonyms. - Add a phantom type parameter to UniqFM/UniqDFM. If you could share your opinion on how to fix this I'd like to fix this soon. Personally I prefer (1) because it looks simpler but I'd be happy with (2) as well. Ömer _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs