generic-type-functions-0.1.0: Familiar functions lifted to type-level functions on generic types
Safe HaskellSafe-Inferred
LanguageGHC2021

Generic.Type.Function.FoldMap

Synopsis
  • type family GTFoldMapC tmappend tmempty f gf where ...

Documentation

type family GTFoldMapC tmappend tmempty f gf where ... Source #

foldMap on generic type representations (field product level).

Will work for single-constructor types as well thanks to meta unwrapping.

Equations

GTFoldMapC tmappend tmempty f U1 = tmempty 
GTFoldMapC tmappend tmempty f (K1 i c) = f @@ c 
GTFoldMapC tmappend tmempty f (l :*: r) = (tmappend @@ GTFoldMapC tmappend tmempty f l) @@ GTFoldMapC tmappend tmempty f r 
GTFoldMapC tmappend tmempty f (M1 _ _ gf) = GTFoldMapC tmappend tmempty f gf