semigroupoids-6: Semigroupoids: Category sans id
Copyright(C) 2011-2015 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Semigroup.Foldable

Description

Re-exports a subset of the Data.Foldable1 module along with some additional combinators that require Foldable1 constraints.

Synopsis

Documentation

class Foldable t => Foldable1 (t :: TYPE LiftedRep -> Type) where #

Non-empty data structures that can be folded.

Minimal complete definition

foldMap1 | foldrMap1

Methods

fold1 :: Semigroup m => t m -> m #

Combine the elements of a structure using a semigroup.

foldMap1 :: Semigroup m => (a -> m) -> t a -> m #

Map each element of the structure to a semigroup, and combine the results.

>>> foldMap1 Sum (1 :| [2, 3, 4])
Sum {getSum = 10}

toNonEmpty :: t a -> NonEmpty a #

List of elements of a structure, from left to right.

>>> toNonEmpty (Identity 2)
2 :| []

Instances

Instances details
Foldable1 Complex 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Complex m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Complex a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Complex a -> m #

toNonEmpty :: Complex a -> NonEmpty a #

maximum :: Ord a => Complex a -> a #

minimum :: Ord a => Complex a -> a #

head :: Complex a -> a #

last :: Complex a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Complex a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Complex a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Complex a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Complex a -> b #

Foldable1 Identity 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Identity m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Identity a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Identity a -> m #

toNonEmpty :: Identity a -> NonEmpty a #

maximum :: Ord a => Identity a -> a #

minimum :: Ord a => Identity a -> a #

head :: Identity a -> a #

last :: Identity a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Identity a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Identity a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Identity a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Identity a -> b #

Foldable1 Down 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Down m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Down a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Down a -> m #

toNonEmpty :: Down a -> NonEmpty a #

maximum :: Ord a => Down a -> a #

minimum :: Ord a => Down a -> a #

head :: Down a -> a #

last :: Down a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Down a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Down a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Down a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Down a -> b #

Foldable1 First 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => First m -> m #

foldMap1 :: Semigroup m => (a -> m) -> First a -> m #

foldMap1' :: Semigroup m => (a -> m) -> First a -> m #

toNonEmpty :: First a -> NonEmpty a #

maximum :: Ord a => First a -> a #

minimum :: Ord a => First a -> a #

head :: First a -> a #

last :: First a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> First a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> First a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> First a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> First a -> b #

Foldable1 Last 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Last m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Last a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Last a -> m #

toNonEmpty :: Last a -> NonEmpty a #

maximum :: Ord a => Last a -> a #

minimum :: Ord a => Last a -> a #

head :: Last a -> a #

last :: Last a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Last a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Last a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Last a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Last a -> b #

Foldable1 Max 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Max m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Max a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Max a -> m #

toNonEmpty :: Max a -> NonEmpty a #

maximum :: Ord a => Max a -> a #

minimum :: Ord a => Max a -> a #

head :: Max a -> a #

last :: Max a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Max a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Max a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Max a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Max a -> b #

Foldable1 Min 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Min m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Min a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Min a -> m #

toNonEmpty :: Min a -> NonEmpty a #

maximum :: Ord a => Min a -> a #

minimum :: Ord a => Min a -> a #

head :: Min a -> a #

last :: Min a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Min a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Min a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Min a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Min a -> b #

Foldable1 Dual 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Dual m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Dual a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Dual a -> m #

toNonEmpty :: Dual a -> NonEmpty a #

maximum :: Ord a => Dual a -> a #

minimum :: Ord a => Dual a -> a #

head :: Dual a -> a #

last :: Dual a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Dual a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Dual a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Dual a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Dual a -> b #

Foldable1 Product 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Product m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Product a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Product a -> m #

toNonEmpty :: Product a -> NonEmpty a #

maximum :: Ord a => Product a -> a #

minimum :: Ord a => Product a -> a #

head :: Product a -> a #

last :: Product a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Product a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Product a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Product a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Product a -> b #

Foldable1 Sum 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Sum m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Sum a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Sum a -> m #

toNonEmpty :: Sum a -> NonEmpty a #

maximum :: Ord a => Sum a -> a #

minimum :: Ord a => Sum a -> a #

head :: Sum a -> a #

last :: Sum a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Sum a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Sum a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Sum a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Sum a -> b #

Foldable1 Par1 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Par1 m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Par1 a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Par1 a -> m #

toNonEmpty :: Par1 a -> NonEmpty a #

maximum :: Ord a => Par1 a -> a #

minimum :: Ord a => Par1 a -> a #

head :: Par1 a -> a #

last :: Par1 a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Par1 a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Par1 a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Par1 a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Par1 a -> b #

Foldable1 Tree 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Tree m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Tree a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Tree a -> m #

toNonEmpty :: Tree a -> NonEmpty a #

maximum :: Ord a => Tree a -> a #

minimum :: Ord a => Tree a -> a #

head :: Tree a -> a #

last :: Tree a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Tree a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Tree a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Tree a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Tree a -> b #

Foldable1 NonEmpty 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => NonEmpty m -> m #

foldMap1 :: Semigroup m => (a -> m) -> NonEmpty a -> m #

foldMap1' :: Semigroup m => (a -> m) -> NonEmpty a -> m #

toNonEmpty :: NonEmpty a -> NonEmpty a #

maximum :: Ord a => NonEmpty a -> a #

minimum :: Ord a => NonEmpty a -> a #

head :: NonEmpty a -> a #

last :: NonEmpty a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> NonEmpty a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> NonEmpty a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> NonEmpty a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> NonEmpty a -> b #

Foldable1 Solo 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Solo m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Solo a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Solo a -> m #

toNonEmpty :: Solo a -> NonEmpty a #

maximum :: Ord a => Solo a -> a #

minimum :: Ord a => Solo a -> a #

head :: Solo a -> a #

last :: Solo a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Solo a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Solo a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Solo a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Solo a -> b #

Foldable1 (V1 :: TYPE LiftedRep -> Type) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => V1 m -> m #

foldMap1 :: Semigroup m => (a -> m) -> V1 a -> m #

foldMap1' :: Semigroup m => (a -> m) -> V1 a -> m #

toNonEmpty :: V1 a -> NonEmpty a #

maximum :: Ord a => V1 a -> a #

minimum :: Ord a => V1 a -> a #

head :: V1 a -> a #

last :: V1 a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> V1 a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> V1 a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> V1 a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> V1 a -> b #

Foldable1 f => Foldable1 (Lift f) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Lift f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Lift f a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Lift f a -> m #

toNonEmpty :: Lift f a -> NonEmpty a #

maximum :: Ord a => Lift f a -> a #

minimum :: Ord a => Lift f a -> a #

head :: Lift f a -> a #

last :: Lift f a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Lift f a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Lift f a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Lift f a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Lift f a -> b #

Foldable1 ((,) a) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => (a, m) -> m #

foldMap1 :: Semigroup m => (a0 -> m) -> (a, a0) -> m #

foldMap1' :: Semigroup m => (a0 -> m) -> (a, a0) -> m #

toNonEmpty :: (a, a0) -> NonEmpty a0 #

maximum :: Ord a0 => (a, a0) -> a0 #

minimum :: Ord a0 => (a, a0) -> a0 #

head :: (a, a0) -> a0 #

last :: (a, a0) -> a0 #

foldrMap1 :: (a0 -> b) -> (a0 -> b -> b) -> (a, a0) -> b #

foldlMap1' :: (a0 -> b) -> (b -> a0 -> b) -> (a, a0) -> b #

foldlMap1 :: (a0 -> b) -> (b -> a0 -> b) -> (a, a0) -> b #

foldrMap1' :: (a0 -> b) -> (a0 -> b -> b) -> (a, a0) -> b #

Foldable1 f => Foldable1 (Ap f) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Ap f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Ap f a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Ap f a -> m #

toNonEmpty :: Ap f a -> NonEmpty a #

maximum :: Ord a => Ap f a -> a #

minimum :: Ord a => Ap f a -> a #

head :: Ap f a -> a #

last :: Ap f a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Ap f a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Ap f a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Ap f a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Ap f a -> b #

Foldable1 f => Foldable1 (Alt f) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Alt f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Alt f a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Alt f a -> m #

toNonEmpty :: Alt f a -> NonEmpty a #

maximum :: Ord a => Alt f a -> a #

minimum :: Ord a => Alt f a -> a #

head :: Alt f a -> a #

last :: Alt f a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Alt f a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Alt f a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Alt f a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Alt f a -> b #

Foldable1 f => Foldable1 (Rec1 f) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Rec1 f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Rec1 f a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Rec1 f a -> m #

toNonEmpty :: Rec1 f a -> NonEmpty a #

maximum :: Ord a => Rec1 f a -> a #

minimum :: Ord a => Rec1 f a -> a #

head :: Rec1 f a -> a #

last :: Rec1 f a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Rec1 f a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Rec1 f a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Rec1 f a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Rec1 f a -> b #

Bifoldable1 p => Foldable1 (Join p) 
Instance details

Defined in Data.Bifunctor.Join

Methods

fold1 :: Semigroup m => Join p m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Join p a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Join p a -> m #

toNonEmpty :: Join p a -> NonEmpty a #

maximum :: Ord a => Join p a -> a #

minimum :: Ord a => Join p a -> a #

head :: Join p a -> a #

last :: Join p a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Join p a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Join p a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Join p a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Join p a -> b #

Foldable1 (Tagged b) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Tagged b m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Tagged b a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Tagged b a -> m #

toNonEmpty :: Tagged b a -> NonEmpty a #

maximum :: Ord a => Tagged b a -> a #

minimum :: Ord a => Tagged b a -> a #

head :: Tagged b a -> a #

last :: Tagged b a -> a #

foldrMap1 :: (a -> b0) -> (a -> b0 -> b0) -> Tagged b a -> b0 #

foldlMap1' :: (a -> b0) -> (b0 -> a -> b0) -> Tagged b a -> b0 #

foldlMap1 :: (a -> b0) -> (b0 -> a -> b0) -> Tagged b a -> b0 #

foldrMap1' :: (a -> b0) -> (a -> b0 -> b0) -> Tagged b a -> b0 #

Foldable1 f => Foldable1 (Backwards f) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Backwards f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Backwards f a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Backwards f a -> m #

toNonEmpty :: Backwards f a -> NonEmpty a #

maximum :: Ord a => Backwards f a -> a #

minimum :: Ord a => Backwards f a -> a #

head :: Backwards f a -> a #

last :: Backwards f a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Backwards f a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Backwards f a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Backwards f a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Backwards f a -> b #

Foldable1 f => Foldable1 (IdentityT f) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => IdentityT f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> IdentityT f a -> m #

foldMap1' :: Semigroup m => (a -> m) -> IdentityT f a -> m #

toNonEmpty :: IdentityT f a -> NonEmpty a #

maximum :: Ord a => IdentityT f a -> a #

minimum :: Ord a => IdentityT f a -> a #

head :: IdentityT f a -> a #

last :: IdentityT f a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> IdentityT f a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> IdentityT f a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> IdentityT f a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> IdentityT f a -> b #

Foldable1 f => Foldable1 (Reverse f) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Reverse f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Reverse f a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Reverse f a -> m #

toNonEmpty :: Reverse f a -> NonEmpty a #

maximum :: Ord a => Reverse f a -> a #

minimum :: Ord a => Reverse f a -> a #

head :: Reverse f a -> a #

last :: Reverse f a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Reverse f a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Reverse f a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Reverse f a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Reverse f a -> b #

(Foldable1 f, Foldable1 g) => Foldable1 (Product f g)

It would be enough for either half of a product to be Foldable1. Other could be Foldable.

Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Product f g m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Product f g a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Product f g a -> m #

toNonEmpty :: Product f g a -> NonEmpty a #

maximum :: Ord a => Product f g a -> a #

minimum :: Ord a => Product f g a -> a #

head :: Product f g a -> a #

last :: Product f g a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Product f g a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Product f g a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Product f g a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Product f g a -> b #

(Foldable1 f, Foldable1 g) => Foldable1 (Sum f g) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Sum f g m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Sum f g a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Sum f g a -> m #

toNonEmpty :: Sum f g a -> NonEmpty a #

maximum :: Ord a => Sum f g a -> a #

minimum :: Ord a => Sum f g a -> a #

head :: Sum f g a -> a #

last :: Sum f g a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Sum f g a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Sum f g a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Sum f g a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Sum f g a -> b #

(Foldable1 f, Foldable1 g) => Foldable1 (f :*: g) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => (f :*: g) m -> m #

foldMap1 :: Semigroup m => (a -> m) -> (f :*: g) a -> m #

foldMap1' :: Semigroup m => (a -> m) -> (f :*: g) a -> m #

toNonEmpty :: (f :*: g) a -> NonEmpty a #

maximum :: Ord a => (f :*: g) a -> a #

minimum :: Ord a => (f :*: g) a -> a #

head :: (f :*: g) a -> a #

last :: (f :*: g) a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> (f :*: g) a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> (f :*: g) a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> (f :*: g) a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> (f :*: g) a -> b #

(Foldable1 f, Foldable1 g) => Foldable1 (f :+: g) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => (f :+: g) m -> m #

foldMap1 :: Semigroup m => (a -> m) -> (f :+: g) a -> m #

foldMap1' :: Semigroup m => (a -> m) -> (f :+: g) a -> m #

toNonEmpty :: (f :+: g) a -> NonEmpty a #

maximum :: Ord a => (f :+: g) a -> a #

minimum :: Ord a => (f :+: g) a -> a #

head :: (f :+: g) a -> a #

last :: (f :+: g) a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> (f :+: g) a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> (f :+: g) a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> (f :+: g) a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> (f :+: g) a -> b #

(Foldable1 f, Foldable1 g) => Foldable1 (Compose f g) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => Compose f g m -> m #

foldMap1 :: Semigroup m => (a -> m) -> Compose f g a -> m #

foldMap1' :: Semigroup m => (a -> m) -> Compose f g a -> m #

toNonEmpty :: Compose f g a -> NonEmpty a #

maximum :: Ord a => Compose f g a -> a #

minimum :: Ord a => Compose f g a -> a #

head :: Compose f g a -> a #

last :: Compose f g a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> Compose f g a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> Compose f g a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> Compose f g a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> Compose f g a -> b #

(Foldable1 f, Foldable1 g) => Foldable1 (f :.: g) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => (f :.: g) m -> m #

foldMap1 :: Semigroup m => (a -> m) -> (f :.: g) a -> m #

foldMap1' :: Semigroup m => (a -> m) -> (f :.: g) a -> m #

toNonEmpty :: (f :.: g) a -> NonEmpty a #

maximum :: Ord a => (f :.: g) a -> a #

minimum :: Ord a => (f :.: g) a -> a #

head :: (f :.: g) a -> a #

last :: (f :.: g) a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> (f :.: g) a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> (f :.: g) a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> (f :.: g) a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> (f :.: g) a -> b #

Foldable1 f => Foldable1 (M1 i c f) 
Instance details

Defined in Data.Foldable1

Methods

fold1 :: Semigroup m => M1 i c f m -> m #

foldMap1 :: Semigroup m => (a -> m) -> M1 i c f a -> m #

foldMap1' :: Semigroup m => (a -> m) -> M1 i c f a -> m #

toNonEmpty :: M1 i c f a -> NonEmpty a #

maximum :: Ord a => M1 i c f a -> a #

minimum :: Ord a => M1 i c f a -> a #

head :: M1 i c f a -> a #

last :: M1 i c f a -> a #

foldrMap1 :: (a -> b) -> (a -> b -> b) -> M1 i c f a -> b #

foldlMap1' :: (a -> b) -> (b -> a -> b) -> M1 i c f a -> b #

foldlMap1 :: (a -> b) -> (b -> a -> b) -> M1 i c f a -> b #

foldrMap1' :: (a -> b) -> (a -> b -> b) -> M1 i c f a -> b #

Foldable1 g => Foldable1 (Joker g a) 
Instance details

Defined in Data.Bifunctor.Joker

Methods

fold1 :: Semigroup m => Joker g a m -> m #

foldMap1 :: Semigroup m => (a0 -> m) -> Joker g a a0 -> m #

foldMap1' :: Semigroup m => (a0 -> m) -> Joker g a a0 -> m #

toNonEmpty :: Joker g a a0 -> NonEmpty a0 #

maximum :: Ord a0 => Joker g a a0 -> a0 #

minimum :: Ord a0 => Joker g a a0 -> a0 #

head :: Joker g a a0 -> a0 #

last :: Joker g a a0 -> a0 #

foldrMap1 :: (a0 -> b) -> (a0 -> b -> b) -> Joker g a a0 -> b #

foldlMap1' :: (a0 -> b) -> (b -> a0 -> b) -> Joker g a a0 -> b #

foldlMap1 :: (a0 -> b) -> (b -> a0 -> b) -> Joker g a a0 -> b #

foldrMap1' :: (a0 -> b) -> (a0 -> b -> b) -> Joker g a a0 -> b #

intercalate1 :: (Foldable1 t, Semigroup m) => m -> t m -> m #

Insert an m between each pair of t m.

>>> intercalate1 ", " $ "hello" :| ["how", "are", "you"]
"hello, how, are, you"
>>> intercalate1 ", " $ "hello" :| []
"hello"
>>> intercalate1 mempty $ "I" :| ["Am", "Fine", "You?"]
"IAmFineYou?"

foldrM1 :: (Foldable1 t, Monad m) => (a -> a -> m a) -> t a -> m a #

Monadic fold over the elements of a non-empty structure, associating to the right, i.e. from right to left.

foldlM1 :: (Foldable1 t, Monad m) => (a -> a -> m a) -> t a -> m a #

Monadic fold over the elements of a non-empty structure, associating to the left, i.e. from left to right.

intercalateMap1 :: (Foldable1 t, Semigroup m) => m -> (a -> m) -> t a -> m Source #

Insert m between each pair of m derived from a.

>>> intercalateMap1 " " show $ True :| [False, True]
"True False True"
>>> intercalateMap1 " " show $ True :| []
"True"

traverse1_ :: (Foldable1 t, Apply f) => (a -> f b) -> t a -> f () Source #

for1_ :: (Foldable1 t, Apply f) => t a -> (a -> f b) -> f () Source #

sequenceA1_ :: (Foldable1 t, Apply f) => t (f a) -> f () Source #

foldMapDefault1 :: (Foldable1 t, Monoid m) => (a -> m) -> t a -> m Source #

Usable default for foldMap, but only if you define foldMap1 yourself

asum1 :: (Foldable1 t, Alt m) => t (m a) -> m a Source #

gfold1 :: (Foldable1 (Rep1 t), Generic1 t, Semigroup m) => t m -> m Source #

Generic fold1. Caveats:

  1. Will not compile if t is an empty constructor.
  2. Will not compile if t has some fields that don't mention a, for exmaple data Bar a = MkBar a Int

Since: 5.3.8

gfoldMap1 :: (Foldable1 (Rep1 t), Generic1 t, Semigroup m) => (a -> m) -> t a -> m Source #

Generic foldMap1. Caveats are the same as for gfold1.

Since: 5.3.8

gtoNonEmpty :: (Foldable1 (Rep1 t), Generic1 t) => t a -> NonEmpty a Source #

Generic toNonEmpty. Caveats are the same as for gfold1.

Since: 5.3.8