Commit 2b523dc3 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

Use System Names for evidence variables

These variables all have uniformative names like "cobox" or "d".
Make them System Names tells the pretty printer to show their
uniques even without -dppr-debug.  That in turn makes the
less-voluminous debug traces *much* more informative.
parent bd2aef69
...@@ -155,17 +155,17 @@ newWantedEvVars theta = mapM newWantedEvVar theta ...@@ -155,17 +155,17 @@ newWantedEvVars theta = mapM newWantedEvVar theta
newEvVar :: TcPredType -> TcM EvVar newEvVar :: TcPredType -> TcM EvVar
-- Creates new *rigid* variables for predicates -- Creates new *rigid* variables for predicates
newEvVar ty = do { name <- newName (predTypeOccName ty) newEvVar ty = do { name <- newSysName (predTypeOccName ty)
; return (mkLocalId name ty) } ; return (mkLocalId name ty) }
newEq :: TcType -> TcType -> TcM EvVar newEq :: TcType -> TcType -> TcM EvVar
newEq ty1 ty2 newEq ty1 ty2
= do { name <- newName (mkVarOccFS (fsLit "cobox")) = do { name <- newSysName (mkVarOccFS (fsLit "cobox"))
; return (mkLocalId name (mkTcEqPred ty1 ty2)) } ; return (mkLocalId name (mkTcEqPred ty1 ty2)) }
newDict :: Class -> [TcType] -> TcM DictId newDict :: Class -> [TcType] -> TcM DictId
newDict cls tys newDict cls tys
= do { name <- newName (mkDictOcc (getOccName cls)) = do { name <- newSysName (mkDictOcc (getOccName cls))
; return (mkLocalId name (mkClassPred cls tys)) } ; return (mkLocalId name (mkClassPred cls tys)) }
predTypeOccName :: PredType -> OccName predTypeOccName :: PredType -> OccName
......
...@@ -376,6 +376,11 @@ newName occ ...@@ -376,6 +376,11 @@ newName occ
; loc <- getSrcSpanM ; loc <- getSrcSpanM
; return (mkInternalName uniq occ loc) } ; return (mkInternalName uniq occ loc) }
newSysName :: OccName -> TcM Name
newSysName occ
= do { uniq <- newUnique
; return (mkSystemName uniq occ) }
newSysLocalIds :: FastString -> [TcType] -> TcRnIf gbl lcl [TcId] newSysLocalIds :: FastString -> [TcType] -> TcRnIf gbl lcl [TcId]
newSysLocalIds fs tys newSysLocalIds fs tys
= do { us <- newUniqueSupply = do { us <- newUniqueSupply
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment