ghc-7.10.0.20150316: The GHC API

Safe HaskellNone
LanguageHaskell2010

Bag

Documentation

data Bag a Source

Instances

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

unitBag :: a -> Bag a Source

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

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

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

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

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 a Source

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

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

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

consBag :: a -> Bag a -> Bag a infixr 3 Source

snocBag :: Bag a -> a -> Bag a infixl 3 Source

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

listToBag :: [a] -> Bag a Source

bagToList :: Bag a -> [a] Source

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

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

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

mapAccumBagLM Source

Arguments

:: Monad m 
=> (acc -> x -> m (acc, y))

combining funcction

-> acc

initial state

-> Bag x

inputs

-> m (acc, Bag y)

final state, outputs