Bag

ghc-7.8.2: The GHC API

Safe Haskell | None
Language | Haskell98

Bag

# Documentation

data Bag a Source

Instances

Data a => Data (Bag a) |
Outputable a => Outputable (Bag a) |
Typeable (* -> *) Bag |

emptyBag :: Bag a Source

unitBag :: a -> Bag a Source

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

unionManyBags :: [Bag a] -> Bag a Source

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

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

lengthBag :: Bag a -> Int 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

isEmptyBag :: Bag a -> Bool Source

isSingletonBag :: Bag a -> Bool 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