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

Safe Haskell | Safe-Inferred

Generics.Deriving.Foldable

Contents

- Foldable class
- Default method
- Derived functions

Synopsis

- class GFoldable t where
  - gfoldMap :: Monoid m => (a -> m) -> t a -> m
  - gfold :: Monoid m => t m -> m
  - gfoldr :: (a -> b -> b) -> b -> t a -> b
  - gfoldr' :: (a -> b -> b) -> b -> t a -> b
  - gfoldl :: (a -> b -> a) -> a -> t b -> a
  - gfoldl' :: (a -> b -> a) -> a -> t b -> a
  - gfoldr1 :: (a -> a -> a) -> t a -> a
  - gfoldl1 :: (a -> a -> a) -> t a -> a
- gfoldMapdefault :: (Generic1 t, GFoldable' (Rep1 t), Monoid m) => (a -> m) -> t a -> m
- gtoList :: GFoldable t => t a -> [a]
- gconcat :: GFoldable t => t [a] -> [a]
- gconcatMap :: GFoldable t => (a -> [b]) -> t a -> [b]
- gand :: GFoldable t => t Bool -> Bool
- gor :: GFoldable t => t Bool -> Bool
- gany :: GFoldable t => (a -> Bool) -> t a -> Bool
- gall :: GFoldable t => (a -> Bool) -> t a -> Bool
- gsum :: (GFoldable t, Num a) => t a -> a
- gproduct :: (GFoldable t, Num a) => t a -> a
- gmaximum :: (GFoldable t, Ord a) => t a -> a
- gmaximumBy :: GFoldable t => (a -> a -> Ordering) -> t a -> a
- gminimum :: (GFoldable t, Ord a) => t a -> a
- gminimumBy :: GFoldable t => (a -> a -> Ordering) -> t a -> a
- gelem :: (GFoldable t, Eq a) => a -> t a -> Bool
- gnotElem :: (GFoldable t, Eq a) => a -> t a -> Bool
- gfind :: GFoldable t => (a -> Bool) -> t a -> Maybe a

# Foldable class

class GFoldable t where Source

Methods

gfoldMap :: Monoid m => (a -> m) -> t a -> mSource

gfold :: Monoid m => t m -> mSource

gfoldr :: (a -> b -> b) -> b -> t a -> bSource

gfoldr' :: (a -> b -> b) -> b -> t a -> bSource

gfoldl :: (a -> b -> a) -> a -> t b -> aSource

gfoldl' :: (a -> b -> a) -> a -> t b -> aSource

gfoldr1 :: (a -> a -> a) -> t a -> aSource

gfoldl1 :: (a -> a -> a) -> t a -> aSource

Instances

GFoldable [] |
GFoldable Maybe |

# Default method

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

# 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

gand :: GFoldable t => t Bool -> Bool 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 -> aSource

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

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

gmaximumBy :: GFoldable t => (a -> a -> Ordering) -> t a -> aSource

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

gminimumBy :: GFoldable t => (a -> a -> Ordering) -> t a -> aSource

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 aSource