GHC.Data.Bag

ghc-lib-parser-9.10.1.20250103: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Data.Bag

# Documentation

data Bag a #

#### Instances

Instances details

Functor Bag # |
Instance details Defined in GHC.Data.Bag Methods fmap :: (a -> b) -> Bag a -> Bag b # (<$) :: a -> Bag b -> Bag a #
Foldable Bag # |
Instance details Defined in GHC.Data.Bag Methods fold :: Monoid m => Bag m -> m # foldMap :: Monoid m => (a -> m) -> Bag a -> m # foldMap' :: Monoid m => (a -> m) -> Bag a -> m # foldr :: (a -> b -> b) -> b -> Bag a -> b # foldr' :: (a -> b -> b) -> b -> Bag a -> b # foldl :: (b -> a -> b) -> b -> Bag a -> b # foldl' :: (b -> a -> b) -> b -> Bag a -> b # foldr1 :: (a -> a -> a) -> Bag a -> a # foldl1 :: (a -> a -> a) -> Bag a -> a # toList :: Bag a -> [a] # null :: Bag a -> Bool # length :: Bag a -> Int # elem :: Eq a => a -> Bag a -> Bool # maximum :: Ord a => Bag a -> a # minimum :: Ord a => Bag a -> a # sum :: Num a => Bag a -> a # product :: Num a => Bag a -> a #
Traversable Bag # |
Instance details Defined in GHC.Data.Bag Methods traverse :: Applicative f => (a -> f b) -> Bag a -> f (Bag b) # sequenceA :: Applicative f => Bag (f a) -> f (Bag a) # mapM :: Monad m => (a -> m b) -> Bag a -> m (Bag b) # sequence :: Monad m => Bag (m a) -> m (Bag a) #
NFData a => NFData (Bag a) # |
Instance details Defined in GHC.Data.Bag Methods rnf :: Bag a -> () #
Monoid (Bag a) # |
Instance details Defined in GHC.Data.Bag Methods mempty :: Bag a # mappend :: Bag a -> Bag a -> Bag a # mconcat :: [Bag a] -> Bag a #
Semigroup (Bag a) # |
Instance details Defined in GHC.Data.Bag Methods (<>) :: Bag a -> Bag a -> Bag a # sconcat :: NonEmpty (Bag a) -> Bag a # stimes :: Integral b => b -> Bag a -> Bag a #
Data a => Data (Bag a) # |
Instance details Defined in GHC.Data.Bag Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Bag a -> c (Bag a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Bag a) # toConstr :: Bag a -> Constr # dataTypeOf :: Bag a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Bag a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Bag a)) # gmapT :: (forall b. Data b => b -> b) -> Bag a -> Bag a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bag a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bag a -> r # gmapQ :: (forall d. Data d => d -> u) -> Bag a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Bag a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bag a -> m (Bag a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bag a -> m (Bag a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bag a -> m (Bag a) #
IsList (Bag a) # |
Instance details Defined in GHC.Data.Bag Associated Types
type Item (Bag a) |
Instance details Defined in GHC.Data.Bag type Item (Bag a) = a
Methods fromList :: [Item (Bag a)] -> Bag a # fromListN :: Int -> [Item (Bag a)] -> Bag a # toList :: Bag a -> [Item (Bag a)] #
Outputable a => Outputable (Bag a) # |
Instance details Defined in GHC.Data.Bag Methods ppr :: Bag a -> SDoc #
type Item (Bag a) # |
Instance details Defined in GHC.Data.Bag type Item (Bag a) = 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 #

pprBag :: Outputable a => Bag a -> SDoc #

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 #

catBagMaybes :: Bag (Maybe a) -> Bag a #

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

isEmptyBag :: Bag a -> Bool #

isSingletonBag :: Bag a -> Bool #

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

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

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

allBag :: (a -> Bool) -> Bag a -> Bool #

listToBag :: [a] -> Bag a #

nonEmptyToBag :: NonEmpty a -> Bag a #

bagToList :: Bag a -> [a] #

headMaybe :: Bag a -> Maybe a #

mapAccumBagL #

Arguments

:: (acc -> x -> (acc, y)) | combining function
-> acc | initial state
-> Bag x | inputs
-> (acc, Bag y) | final state, outputs

concatMapBag :: (a -> Bag b) -> Bag a -> Bag b #

concatMapBagPair :: (a -> (Bag b, Bag c)) -> Bag a -> (Bag b, Bag c) #

mapMaybeBag :: (a -> Maybe b) -> Bag a -> Bag b #

mapMaybeBagM :: Monad m => (a -> m (Maybe b)) -> Bag a -> m (Bag b) #

unzipBag :: Bag (a, b) -> (Bag a, Bag b) #

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

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

lookupBag :: Eq a => a -> Bag (a, b) -> Maybe b #

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 function
-> acc | initial state
-> Bag x | inputs
-> m (acc, Bag y) | final state, outputs

anyBagM :: Monad m => (a -> m Bool) -> Bag a -> m Bool #

filterBagM :: Monad m => (a -> m Bool) -> Bag a -> m (Bag a) #