generic-deriving-1.11.2: Generic programming library for generalised deriving.

Safe HaskellSafe
LanguageHaskell2010

Generics.Deriving.Foldable

Contents

Synopsis

Generic Foldable class

class GFoldable t where Source #

Methods

gfoldMap :: Monoid m => (a -> m) -> t a -> m Source #

gfoldMap :: (Generic1 t, GFoldable' (Rep1 t), Monoid m) => (a -> m) -> t a -> m Source #

gfold :: Monoid m => t m -> m Source #

gfoldr :: (a -> b -> b) -> b -> t a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> t a -> b Source #

gfoldl :: (a -> b -> a) -> a -> t b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> t b -> a Source #

gfoldr1 :: (a -> a -> a) -> t a -> a Source #

gfoldl1 :: (a -> a -> a) -> t a -> a Source #

Instances

GFoldable [] Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> [a] -> m Source #

gfold :: Monoid m => [m] -> m Source #

gfoldr :: (a -> b -> b) -> b -> [a] -> b Source #

gfoldr' :: (a -> b -> b) -> b -> [a] -> b Source #

gfoldl :: (a -> b -> a) -> a -> [b] -> a Source #

gfoldl' :: (a -> b -> a) -> a -> [b] -> a Source #

gfoldr1 :: (a -> a -> a) -> [a] -> a Source #

gfoldl1 :: (a -> a -> a) -> [a] -> a Source #

GFoldable Maybe Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Maybe a -> m Source #

gfold :: Monoid m => Maybe m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Maybe a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Maybe a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Maybe b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Maybe b -> a Source #

gfoldr1 :: (a -> a -> a) -> Maybe a -> a Source #

gfoldl1 :: (a -> a -> a) -> Maybe a -> a Source #

GFoldable Identity Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Identity a -> m Source #

gfold :: Monoid m => Identity m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Identity a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Identity a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Identity b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Identity b -> a Source #

gfoldr1 :: (a -> a -> a) -> Identity a -> a Source #

gfoldl1 :: (a -> a -> a) -> Identity a -> a Source #

GFoldable Min Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Min a -> m Source #

gfold :: Monoid m => Min m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Min a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Min a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Min b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Min b -> a Source #

gfoldr1 :: (a -> a -> a) -> Min a -> a Source #

gfoldl1 :: (a -> a -> a) -> Min a -> a Source #

GFoldable Max Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Max a -> m Source #

gfold :: Monoid m => Max m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Max a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Max a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Max b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Max b -> a Source #

gfoldr1 :: (a -> a -> a) -> Max a -> a Source #

gfoldl1 :: (a -> a -> a) -> Max a -> a Source #

GFoldable First Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> First a -> m Source #

gfold :: Monoid m => First m -> m Source #

gfoldr :: (a -> b -> b) -> b -> First a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> First a -> b Source #

gfoldl :: (a -> b -> a) -> a -> First b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> First b -> a Source #

gfoldr1 :: (a -> a -> a) -> First a -> a Source #

gfoldl1 :: (a -> a -> a) -> First a -> a Source #

GFoldable Last Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Last a -> m Source #

gfold :: Monoid m => Last m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Last a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Last a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Last b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Last b -> a Source #

gfoldr1 :: (a -> a -> a) -> Last a -> a Source #

gfoldl1 :: (a -> a -> a) -> Last a -> a Source #

GFoldable WrappedMonoid Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> WrappedMonoid a -> m Source #

gfold :: Monoid m => WrappedMonoid m -> m Source #

gfoldr :: (a -> b -> b) -> b -> WrappedMonoid a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> WrappedMonoid a -> b Source #

gfoldl :: (a -> b -> a) -> a -> WrappedMonoid b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> WrappedMonoid b -> a Source #

gfoldr1 :: (a -> a -> a) -> WrappedMonoid a -> a Source #

gfoldl1 :: (a -> a -> a) -> WrappedMonoid a -> a Source #

GFoldable Option Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Option a -> m Source #

gfold :: Monoid m => Option m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Option a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Option a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Option b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Option b -> a Source #

gfoldr1 :: (a -> a -> a) -> Option a -> a Source #

gfoldl1 :: (a -> a -> a) -> Option a -> a Source #

GFoldable NonEmpty Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> NonEmpty a -> m Source #

gfold :: Monoid m => NonEmpty m -> m Source #

gfoldr :: (a -> b -> b) -> b -> NonEmpty a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> NonEmpty a -> b Source #

gfoldl :: (a -> b -> a) -> a -> NonEmpty b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> NonEmpty b -> a Source #

gfoldr1 :: (a -> a -> a) -> NonEmpty a -> a Source #

gfoldl1 :: (a -> a -> a) -> NonEmpty a -> a Source #

GFoldable Complex Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Complex a -> m Source #

gfold :: Monoid m => Complex m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Complex a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Complex a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Complex b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Complex b -> a Source #

gfoldr1 :: (a -> a -> a) -> Complex a -> a Source #

gfoldl1 :: (a -> a -> a) -> Complex a -> a Source #

GFoldable ZipList Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> ZipList a -> m Source #

gfold :: Monoid m => ZipList m -> m Source #

gfoldr :: (a -> b -> b) -> b -> ZipList a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> ZipList a -> b Source #

gfoldl :: (a -> b -> a) -> a -> ZipList b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> ZipList b -> a Source #

gfoldr1 :: (a -> a -> a) -> ZipList a -> a Source #

gfoldl1 :: (a -> a -> a) -> ZipList a -> a Source #

GFoldable Dual Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Dual a -> m Source #

gfold :: Monoid m => Dual m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Dual a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Dual a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Dual b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Dual b -> a Source #

gfoldr1 :: (a -> a -> a) -> Dual a -> a Source #

gfoldl1 :: (a -> a -> a) -> Dual a -> a Source #

GFoldable Sum Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Sum a -> m Source #

gfold :: Monoid m => Sum m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Sum a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Sum a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Sum b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Sum b -> a Source #

gfoldr1 :: (a -> a -> a) -> Sum a -> a Source #

gfoldl1 :: (a -> a -> a) -> Sum a -> a Source #

GFoldable Product Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Product a -> m Source #

gfold :: Monoid m => Product m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Product a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Product a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Product b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Product b -> a Source #

gfoldr1 :: (a -> a -> a) -> Product a -> a Source #

gfoldl1 :: (a -> a -> a) -> Product a -> a Source #

GFoldable First Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> First a -> m Source #

gfold :: Monoid m => First m -> m Source #

gfoldr :: (a -> b -> b) -> b -> First a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> First a -> b Source #

gfoldl :: (a -> b -> a) -> a -> First b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> First b -> a Source #

gfoldr1 :: (a -> a -> a) -> First a -> a Source #

gfoldl1 :: (a -> a -> a) -> First a -> a Source #

GFoldable Last Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Last a -> m Source #

gfold :: Monoid m => Last m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Last a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Last a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Last b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Last b -> a Source #

gfoldr1 :: (a -> a -> a) -> Last a -> a Source #

gfoldl1 :: (a -> a -> a) -> Last a -> a Source #

GFoldable (Either a) Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Either a a -> m Source #

gfold :: Monoid m => Either a m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Either a a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Either a a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Either a b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Either a b -> a Source #

gfoldr1 :: (a -> a -> a) -> Either a a -> a Source #

gfoldl1 :: (a -> a -> a) -> Either a a -> a Source #

GFoldable ((,) a) Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> (a, a) -> m Source #

gfold :: Monoid m => (a, m) -> m Source #

gfoldr :: (a -> b -> b) -> b -> (a, a) -> b Source #

gfoldr' :: (a -> b -> b) -> b -> (a, a) -> b Source #

gfoldl :: (a -> b -> a) -> a -> (a, b) -> a Source #

gfoldl' :: (a -> b -> a) -> a -> (a, b) -> a Source #

gfoldr1 :: (a -> a -> a) -> (a, a) -> a Source #

gfoldl1 :: (a -> a -> a) -> (a, a) -> a Source #

GFoldable (Arg a) Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Arg a a -> m Source #

gfold :: Monoid m => Arg a m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Arg a a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Arg a a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Arg a b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Arg a b -> a Source #

gfoldr1 :: (a -> a -> a) -> Arg a a -> a Source #

gfoldl1 :: (a -> a -> a) -> Arg a a -> a Source #

GFoldable (Proxy *) Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Proxy * a -> m Source #

gfold :: Monoid m => Proxy * m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Proxy * a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Proxy * a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Proxy * b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Proxy * b -> a Source #

gfoldr1 :: (a -> a -> a) -> Proxy * a -> a Source #

gfoldl1 :: (a -> a -> a) -> Proxy * a -> a Source #

GFoldable (Const * m) Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Const * m a -> m Source #

gfold :: Monoid m => Const * m m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Const * m a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Const * m a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Const * m b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Const * m b -> a Source #

gfoldr1 :: (a -> a -> a) -> Const * m a -> a Source #

gfoldl1 :: (a -> a -> a) -> Const * m a -> a Source #

(GFoldable f, GFoldable g) => GFoldable (Sum * f g) Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Sum * f g a -> m Source #

gfold :: Monoid m => Sum * f g m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Sum * f g a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Sum * f g a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Sum * f g b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Sum * f g b -> a Source #

gfoldr1 :: (a -> a -> a) -> Sum * f g a -> a Source #

gfoldl1 :: (a -> a -> a) -> Sum * f g a -> a Source #

(GFoldable f, GFoldable g) => GFoldable (Product * f g) Source # 

Methods

gfoldMap :: Monoid m => (a -> m) -> Product * f g a -> m Source #

gfold :: Monoid m => Product * f g m -> m Source #

gfoldr :: (a -> b -> b) -> b -> Product * f g a -> b Source #

gfoldr' :: (a -> b -> b) -> b -> Product * f g a -> b Source #

gfoldl :: (a -> b -> a) -> a -> Product * f g b -> a Source #

gfoldl' :: (a -> b -> a) -> a -> Product * f g b -> a Source #

gfoldr1 :: (a -> a -> a) -> Product * f g a -> a Source #

gfoldl1 :: (a -> a -> a) -> Product * f g a -> a Source #

Default method

gfoldMapdefault :: (Generic1 t, GFoldable' (Rep1 t), Monoid m) => (a -> m) -> t a -> m Source #

Derived functions

gtoList :: GFoldable t => t a -> [a] Source #

gconcat :: GFoldable t => t [a] -> [a] Source #

gconcatMap :: GFoldable t => (a -> [b]) -> t a -> [b] Source #

gor :: GFoldable t => t Bool -> Bool Source #

gany :: GFoldable t => (a -> Bool) -> t a -> Bool Source #

gall :: GFoldable t => (a -> Bool) -> t a -> Bool Source #

gsum :: (GFoldable t, Num a) => t a -> a Source #

gproduct :: (GFoldable t, Num a) => t a -> a Source #

gmaximum :: (GFoldable t, Ord a) => t a -> a Source #

gmaximumBy :: GFoldable t => (a -> a -> Ordering) -> t a -> a Source #

gminimum :: (GFoldable t, Ord a) => t a -> a Source #

gminimumBy :: GFoldable t => (a -> a -> Ordering) -> t a -> a Source #

gelem :: (GFoldable t, Eq a) => a -> t a -> Bool Source #

gnotElem :: (GFoldable t, Eq a) => a -> t a -> Bool Source #

gfind :: GFoldable t => (a -> Bool) -> t a -> Maybe a Source #

Internal Foldable class

class GFoldable' t where Source #

Minimal complete definition

gfoldMap'

Methods

gfoldMap' :: Monoid m => (a -> m) -> t a -> m Source #

Instances

GFoldable' U1 Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> U1 a -> m Source #

GFoldable' Par1 Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> Par1 a -> m Source #

GFoldable' UAddr Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> UAddr a -> m Source #

GFoldable' UChar Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> UChar a -> m Source #

GFoldable' UDouble Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> UDouble a -> m Source #

GFoldable' UFloat Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> UFloat a -> m Source #

GFoldable' UInt Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> UInt a -> m Source #

GFoldable' UWord Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> UWord a -> m Source #

GFoldable f => GFoldable' (Rec1 f) Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> Rec1 f a -> m Source #

GFoldable' (K1 i c) Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> K1 i c a -> m Source #

(GFoldable' f, GFoldable' g) => GFoldable' ((:+:) f g) Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> (f :+: g) a -> m Source #

(GFoldable' f, GFoldable' g) => GFoldable' ((:*:) f g) Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> (f :*: g) a -> m Source #

(GFoldable f, GFoldable' g) => GFoldable' ((:.:) f g) Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> (f :.: g) a -> m Source #

GFoldable' f => GFoldable' (M1 i c f) Source # 

Methods

gfoldMap' :: Monoid m => (a -> m) -> M1 i c f a -> m Source #