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

Safe Haskell | None
Language | Haskell98

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

Minimal complete definition

Nothing

Methods

gfoldMap :: 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 |
GFoldable Identity Source |
GFoldable Maybe Source |
GFoldable (Either a) Source |
GFoldable ((,) a) Source |
GFoldable (Const m) 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

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 -> 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