%
+% (c) The University of Glasgow 2006
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
%
-\section[Bags]{@Bag@: an unordered collection with duplicates}
+
+Bag: an unordered collection with duplicates
\begin{code}
module Bag (
import Outputable
import Util ( isSingleton )
-import List ( partition )
+
+import Data.List ( partition )
\end{code}
\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}