X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Futils%2FBag.lhs;h=d315c42074172c3c4cd2c8b77b9dc5d90049d23e;hb=3da243bf737dc3e26dfbfa943df1fda1ce7c1bab;hp=b107f84a3a43ffcf04a9c9c5fd8ae6ef5ed5a5b8;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/compiler/utils/Bag.lhs b/compiler/utils/Bag.lhs index b107f84..d315c42 100644 --- a/compiler/utils/Bag.lhs +++ b/compiler/utils/Bag.lhs @@ -1,7 +1,9 @@ % +% (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 ( @@ -20,7 +22,8 @@ module Bag ( import Outputable import Util ( isSingleton ) -import List ( partition ) + +import Data.List ( partition ) \end{code} @@ -170,8 +173,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}