HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulekan-extensions-5.2.7Haskell2010

Data.Functor.Day

Eitan Chatav first introduced me to this construction

The Day convolution of two covariant functors is a covariant functor.

Day convolution is usually defined in terms of contravariant functors, however, it just needs a monoidal category, and Hask^op is also monoidal.

Day convolution can be used to nicely describe monoidal functors as monoid objects w.r.t this product.

http://ncatlab.org/nlab/show/Day+convolution

  • 1 type
  • 13 values
datadata Day (f :: Type -> Type) (g :: Type -> Type) a
#

The Day convolution of two covariant functors.

Constructors

  • forall b c. Day (f b) (g c) (b -> c -> a)
Instances9ComonadTrans, Functor, Applicative, Distributive, Comonad, ComonadApply, …
valueday :: f (a -> b) -> g a -> Day f g b
#

Construct the Day convolution

valuetrans1 :: (forall x. f x -> g x) -> Day f h a -> Day g h a
#

Apply a natural transformation to the left-hand side of a Day convolution.

This respects the naturality of the natural transformation you supplied:

fmap f . trans1 fg = trans1 fg . fmap f
valuetrans2 :: (forall x. g x -> h x) -> Day f g a -> Day f h a
#

Apply a natural transformation to the right-hand side of a Day convolution.

This respects the naturality of the natural transformation you supplied:

fmap f . trans2 fg = trans2 fg . fmap f