packages feed

pqueue-1.4.3.0 / src / Data / PQueue / Internals / Foldable.hs

-- | Writing 'Foldable' instances for non-regular (AKA, nested) types in the-- natural manner leads to full `Foldable` dictionaries being constructed on-- each recursive call. This is pretty inefficient. It's better to construct-- exactly what we need instead.module Data.PQueue.Internals.Foldable  ( Foldr (..)  , Foldl (..)  , FoldMap (..)  , Foldl' (..)  , IFoldr (..)  , IFoldl (..)  , IFoldMap (..)  , IFoldl' (..)  ) whereclass Foldr t where  foldr_ :: (a -> b -> b) -> b -> t a -> bclass IFoldr t where  foldrWithKey_ :: (k -> a -> b -> b) -> b -> t k a -> bclass Foldl t where  foldl_ :: (b -> a -> b) -> b -> t a -> bclass IFoldl t where  foldlWithKey_ :: (b -> k -> a -> b) -> b -> t k a -> bclass FoldMap t where  foldMap_ :: Monoid m => (a -> m) -> t a -> mclass IFoldMap t where  foldMapWithKey_ :: Monoid m => (k -> a -> m) -> t k a -> mclass Foldl' t where  foldl'_ :: (b -> a -> b) -> b -> t a -> bclass IFoldl' t where  foldlWithKey'_ :: (b -> k -> a -> b) -> b -> t k a -> b