indexed-traversable-0.1.4: FunctorWithIndex, FoldableWithIndex, TraversableWithIndex
Safe HaskellSafe
LanguageHaskell2010

Data.Foldable1.WithIndex

Description

Indexed non-empty Foldables.

Synopsis

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.

Minimal complete definition

ifoldMap1 | ifoldrMap1

Methods

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

Instances details
Foldable1WithIndex Int NonEmpty Source # 
Instance details

Defined in WithIndex

Methods

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 #