ghc-7.0.4: The GHC API

Bag

# Documentation

data Bag a Source

Instances

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

emptyBag :: Bag aSource

unitBag :: a -> Bag aSource

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

unionManyBags :: [Bag a] -> Bag aSource

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

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

lengthBag :: Bag a -> Int Source

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

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

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

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

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

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

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

isEmptyBag :: Bag a -> Bool Source

isSingletonBag :: Bag a -> Bool Source

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

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

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

listToBag :: [a] -> Bag aSource

bagToList :: Bag a -> [a]Source

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

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

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

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

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

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

mapAccumBagLMSource

Arguments

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