Bag

ghc-7.0.4: The GHC API

Bag

# Documentation

data Bag a

Instances

Typeable1 Bag |
Data a => Data (Bag a) |
Outputable a => Outputable (Bag a) |

emptyBag :: Bag a

unitBag :: a -> Bag a

unionBags :: Bag a -> Bag a -> Bag a

unionManyBags :: [Bag a] -> Bag a

mapBag :: (a -> b) -> Bag a -> Bag b

elemBag :: Eq a => a -> Bag a -> Bool

lengthBag :: Bag a -> Int

filterBag :: (a -> Bool) -> Bag a -> Bag a

partitionBag :: (a -> Bool) -> Bag a -> (Bag a, Bag a)

partitionBagWith :: (a -> Either b c) -> Bag a -> (Bag b, Bag c)

concatBag :: Bag (Bag a) -> Bag a

foldBag :: (r -> r -> r) -> (a -> r) -> r -> Bag a -> r

foldrBag :: (a -> r -> r) -> r -> Bag a -> r

foldlBag :: (r -> a -> r) -> r -> Bag a -> r

isEmptyBag :: Bag a -> Bool

isSingletonBag :: Bag a -> Bool

consBag :: a -> Bag a -> Bag a

snocBag :: Bag a -> a -> Bag a

anyBag :: (a -> Bool) -> Bag a -> Bool

listToBag :: [a] -> Bag a

bagToList :: Bag a -> [a]

foldlBagM :: Monad m => (b -> a -> m b) -> b -> Bag a -> m b

mapBagM :: Monad m => (a -> m b) -> Bag a -> m (Bag b)

mapBagM_ :: Monad m => (a -> m b) -> Bag a -> m ()

flatMapBagM :: Monad m => (a -> m (Bag b)) -> Bag a -> m (Bag b)

flatMapBagPairM :: Monad m => (a -> m (Bag b, Bag c)) -> Bag a -> m (Bag b, Bag c)

mapAndUnzipBagM :: Monad m => (a -> m (b, c)) -> Bag a -> m (Bag b, Bag c)

mapAccumBagLM

Arguments

:: Monad m |
=> (acc -> x -> m (acc, y)) | combining funcction
-> acc | initial state
-> Bag x | inputs
-> m (acc, Bag y) | final state, outputs