Hoogle Search
Within LTS Haskell 24.45 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
one-liner Generics.OneLiner Map each component of a structure to a monoid, and combine the results. If you have a class Size, which measures the size of a structure, then this could be the default implementation:
size = succ . getSum . gfoldMap @Size (Sum . size)
gfoldMap is gtraverse specialized to Const. -
one-liner Generics.OneLiner foldMap = gfoldMap1 @Foldable foldMap
gfoldMap1 is gtraverse1 specialized to Const. -
one-liner Generics.OneLiner Map each component of a structure to a linear monoid, and combine the results. For example. this could be the default implementation of Consumable:
consume = glfoldMap @Consumable consume
glfoldMap is gltraverse specialized to Const. glmap :: forall c t . (ADT t, Constraints t c) => (forall s . c s => s % 1 -> s) -> t % 1 -> tone-liner Generics.OneLiner Map over a structure linearly, updating each component. glmap is generic specialized to the linear arrow.
-
one-liner Generics.OneLiner fmap = gmap1 @Functor fmap
glmap1 is generic1 specialized to the linear arrow. gmap :: forall c t . (ADT t, Constraints t c) => (forall s . c s => s -> s) -> t -> tone-liner Generics.OneLiner Map over a structure, updating each component. gmap is generic specialized to (->).
-
one-liner Generics.OneLiner fmap = gmap1 @Functor fmap
gmap1 is generic1 specialized to (->). -
one-liner Generics.OneLiner.Binary Map over a structure linearly, updating each component. glmap is generic specialized to the linear arrow.
-
one-liner Generics.OneLiner.Binary -
one-liner Generics.OneLiner.Binary Map over a structure, updating each component. gmap is generic specialized to (->).