Commit cfb0b1f9 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

More debugger output order consistency

parent 5e5cecc9
...@@ -611,9 +611,11 @@ runBreakCmd info = do ...@@ -611,9 +611,11 @@ runBreakCmd info = do
printTypeOfNames :: Session -> [Name] -> GHCi () printTypeOfNames :: Session -> [Name] -> GHCi ()
printTypeOfNames session names 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 -> Name -> GHCi ()
printTypeOfName session n printTypeOfName session n
...@@ -1258,9 +1260,12 @@ showBindings = do ...@@ -1258,9 +1260,12 @@ showBindings = do
s <- getSession s <- getSession
unqual <- io (GHC.getPrintUnqual s) unqual <- io (GHC.getPrintUnqual s)
bindings <- io (GHC.getBindings 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 :: TyThing -> GHCi ()
printTyThing (AnId id) = do printTyThing (AnId id) = do
ty' <- cleanType (GHC.idType id) ty' <- cleanType (GHC.idType id)
......
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