Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Indexed non-empty Foldables.
Synopsis
- class (Foldable1 f, FoldableWithIndex i f) => Foldable1WithIndex i (f :: Type -> Type) | f -> i where
- ifoldMap1 :: Semigroup m => (i -> a -> m) -> f a -> m
- ifoldMap1' :: Semigroup m => (i -> a -> m) -> f a -> m
- ifoldrMap1 :: (i -> a -> b) -> (i -> a -> b -> b) -> f a -> b
- ifoldlMap1' :: (i -> a -> b) -> (i -> b -> a -> b) -> f a -> b
- ifoldlMap1 :: (i -> a -> b) -> (i -> b -> a -> b) -> f a -> b
- ifoldrMap1' :: (i -> a -> b) -> (i -> a -> b -> b) -> f a -> b
Indexed Foldables
class (Foldable1 f, FoldableWithIndex i f) => Foldable1WithIndex i (f :: Type -> Type) | f -> i where Source #
A non-empty container that supports folding with an additional index.
ifoldMap1 :: Semigroup m => (i -> a -> m) -> f a -> m Source #
Map each element of the structure to a semigroup, and combine the results.
ifoldMap1' :: Semigroup m => (i -> a -> m) -> f a -> m Source #
A variant of ifoldMap1
that is strict in the accumulator.
ifoldrMap1 :: (i -> a -> b) -> (i -> a -> b -> b) -> f a -> b Source #
Generalized ifoldr1
.
ifoldlMap1' :: (i -> a -> b) -> (i -> b -> a -> b) -> f a -> b Source #
Generalized ifoldl1'
.
ifoldlMap1 :: (i -> a -> b) -> (i -> b -> a -> b) -> f a -> b Source #
Generalized ifoldl1
.
ifoldrMap1' :: (i -> a -> b) -> (i -> a -> b -> b) -> f a -> b Source #
Generalized ifoldr1'
.
Instances
Foldable1WithIndex Int NonEmpty Source # | |
Defined in WithIndex ifoldMap1 :: Semigroup m => (Int -> a -> m) -> NonEmpty a -> m Source # ifoldMap1' :: Semigroup m => (Int -> a -> m) -> NonEmpty a -> m Source # ifoldrMap1 :: (Int -> a -> b) -> (Int -> a -> b -> b) -> NonEmpty a -> b Source # ifoldlMap1' :: (Int -> a -> b) -> (Int -> b -> a -> b) -> NonEmpty a -> b Source # ifoldlMap1 :: (Int -> a -> b) -> (Int -> b -> a -> b) -> NonEmpty a -> b Source # ifoldrMap1' :: (Int -> a -> b) -> (Int -> a -> b -> b) -> NonEmpty a -> b Source # |