Go to the first, previous, next, last section, table of contents.

The `Bag' type

A bag is an unordered collection of elements which may contain duplicates. To use, `import Bag'.

emptyBag        :: Bag elt
unitBag         :: elt -> Bag elt

unionBags       :: Bag elt   -> Bag elt -> Bag elt
unionManyBags   :: [Bag elt] -> Bag elt
snocBag         :: Bag elt   -> elt     -> Bag elt

elemBag         :: Eq elt => elt -> Bag elt -> Bool
isEmptyBag      ::                  Bag elt -> Bool
filterBag       :: (elt -> Bool) -> Bag elt -> Bag elt
partitionBag    :: (elt -> Bool) -> Bag elt-> (Bag elt, Bag elt)
        -- returns the elements that do/don't satisfy the predicate

listToBag       :: [elt] -> Bag elt
bagToList       :: Bag elt -> [elt]


Go to the first, previous, next, last section, table of contents.