projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5e5cecc
)
More debugger output order consistency
author
Ian Lynagh
<igloo@earth.li>
Mon, 18 Jun 2007 10:28:50 +0000
(10:28 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Mon, 18 Jun 2007 10:28:50 +0000
(10:28 +0000)
compiler/ghci/InteractiveUI.hs
patch
|
blob
|
history
diff --git
a/compiler/ghci/InteractiveUI.hs
b/compiler/ghci/InteractiveUI.hs
index
4494f22
..
4c81bf4
100644
(file)
--- a/
compiler/ghci/InteractiveUI.hs
+++ b/
compiler/ghci/InteractiveUI.hs
@@
-611,9
+611,11
@@
runBreakCmd info = do
printTypeOfNames :: Session -> [Name] -> GHCi ()
printTypeOfNames session names
printTypeOfNames :: Session -> [Name] -> GHCi ()
printTypeOfNames session names
- = mapM_ (printTypeOfName session) $ sortBy compareFun names
+ = mapM_ (printTypeOfName session) $ sortBy compareNames names
+
+compareNames :: Name -> Name -> Ordering
+n1 `compareNames` n2 = compareWith n1 `compare` compareWith n2
where compareWith n = (getOccString n, getSrcSpan n)
where compareWith n = (getOccString n, getSrcSpan n)
- compareFun n1 n2 = compareWith n1 `compare` compareWith n2
printTypeOfName :: Session -> Name -> GHCi ()
printTypeOfName session n
printTypeOfName :: Session -> Name -> GHCi ()
printTypeOfName session n
@@
-1258,9
+1260,12
@@
showBindings = do
s <- getSession
unqual <- io (GHC.getPrintUnqual s)
bindings <- io (GHC.getBindings s)
s <- getSession
unqual <- io (GHC.getPrintUnqual s)
bindings <- io (GHC.getBindings s)
- mapM_ printTyThing bindings
+ mapM_ printTyThing $ sortBy compareTyThings bindings
return ()
return ()
+compareTyThings :: TyThing -> TyThing -> Ordering
+t1 `compareTyThings` t2 = getName t1 `compareNames` getName t2
+
printTyThing :: TyThing -> GHCi ()
printTyThing (AnId id) = do
ty' <- cleanType (GHC.idType id)
printTyThing :: TyThing -> GHCi ()
printTyThing (AnId id) = do
ty' <- cleanType (GHC.idType id)