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:
1dfd773
)
Improve pretty-printing for bags
author
simonpj@microsoft.com
<unknown>
Mon, 12 Jun 2006 11:40:20 +0000
(11:40 +0000)
committer
simonpj@microsoft.com
<unknown>
Mon, 12 Jun 2006 11:40:20 +0000
(11:40 +0000)
compiler/utils/Bag.lhs
patch
|
blob
|
history
diff --git
a/compiler/utils/Bag.lhs
b/compiler/utils/Bag.lhs
index
b107f84
..
ea85a8c
100644
(file)
--- a/
compiler/utils/Bag.lhs
+++ b/
compiler/utils/Bag.lhs
@@
-170,8
+170,5
@@
bagToList b = foldrBag (:) [] b
\begin{code}
instance (Outputable a) => Outputable (Bag a) where
- ppr EmptyBag = ptext SLIT("emptyBag")
- ppr (UnitBag a) = ppr a
- ppr (TwoBags b1 b2) = hsep [ppr b1 <> comma, ppr b2]
- ppr (ListBag as) = interpp'SP as
+ ppr bag = char '<' <> pprWithCommas ppr (bagToList bag) <> char '>'
\end{code}