generic-data-functions-0.5.1: Familiar functions lifted to generic data types
Safe HaskellSafe-Inferred
LanguageGHC2021

Generic.Data.Function.FoldMap.Constructor

Synopsis

Documentation

class GenericFoldMap tag where Source #

Implementation enumeration type class for generic foldMap.

The type variable is uninstantiated, used purely as a tag. Good types include the type class used inside (providing you define the type class/it's not an orphan instance), or a custom void data type. See the binrep library on Hackage for an example.

Associated Types

type GenericFoldMapM tag :: Type Source #

The target Monoid to foldMap to.

type GenericFoldMapC tag a :: Constraint Source #

The type class providing the map function in foldMap for permitted types.

Methods

genericFoldMapF :: GenericFoldMapC tag a => a -> GenericFoldMapM tag Source #

The map function in foldMap (first argument).

Instances

Instances details
GenericFoldMap Showly Source # 
Instance details

Defined in Generic.Data.Function.Example

Monoid m => GenericFoldMap (EmptyRec0 m :: Type) Source #

foldMap over types where all fields map to mempty.

Instance details

Defined in Generic.Data.Function.FoldMap.Constructor

Associated Types

type GenericFoldMapM (EmptyRec0 m) Source #

type GenericFoldMapC (EmptyRec0 m) a Source #

GenericFoldMap (NoRec0 m :: Type) Source #

foldMap over types with no fields in any constructor.

Instance details

Defined in Generic.Data.Function.FoldMap.Constructor

Associated Types

type GenericFoldMapM (NoRec0 m) Source #

type GenericFoldMapC (NoRec0 m) a Source #

class GFoldMapC tag f where Source #

foldMap on individual constructors (products).

Methods

gFoldMapC :: f p -> GenericFoldMapM tag Source #

Instances

Instances details
Monoid (GenericFoldMapM tag) => GFoldMapC (tag :: k1) (U1 :: k2 -> Type) Source #

Wow, look! Nothing!

Instance details

Defined in Generic.Data.Function.FoldMap.Constructor

Methods

gFoldMapC :: forall (p :: k10). U1 p -> GenericFoldMapM tag Source #

(Semigroup (GenericFoldMapM tag), GFoldMapC tag l, GFoldMapC tag r) => GFoldMapC (tag :: k1) (l :*: r :: k2 -> Type) Source #

foldMap on individual constructors (products).

Instance details

Defined in Generic.Data.Function.FoldMap.Constructor

Methods

gFoldMapC :: forall (p :: k10). (l :*: r) p -> GenericFoldMapM tag Source #

(GenericFoldMap tag, GenericFoldMapC tag a) => GFoldMapC (tag :: k1) (S1 c (Rec0 a) :: k2 -> Type) Source # 
Instance details

Defined in Generic.Data.Function.FoldMap.Constructor

Methods

gFoldMapC :: forall (p :: k10). S1 c (Rec0 a) p -> GenericFoldMapM tag Source #