Day

trait Day[F[_], G[_], A]

Covariant Day Convolution

Based on Edward Kmett implementation in Haskell: https://hackage.haskell.org/package/kan-extensions/docs/Data-Functor-Day.html

Day convolution is a special form of Functor multiplication. In monoidal category of endofunctors Applicative is a monoid object when Day covolution is used as tensor. If we use Functor composition as tensor then then monoid form a Monad instead of Applicative.

Can be seen as generalization of method apply2 from Apply:

def apply2(fa => F[A], fb => F[B])(f: (A, B) => C): F[C]

trait Day[F[_], G[_], A] { self =>
 // ...
 val fx: F[X]
 val gy: G[Y]
 def xya: (X, Y) => A
}
See also
Companion
object
class Object
trait Matchable
class Any
Day[F, G, A]

Type members

Types

type X
type Y

Value members

Abstract methods

def xya: (X, Y) => A

Concrete methods

def cobind[B](f: Day[F, G, A] => B): Day[F, G, B]
def map[B](f: A => B): Day[F, G, B]
def swapped: Day[G, F, A]

Swap type constructors order

Swap type constructors order

def trans1[H[_]](nat: NaturalTransformation[F, H]): Day[H, G, A]

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

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

def trans2[H[_]](nat: NaturalTransformation[G, H]): Day[F, H, A]

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

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

Abstract fields

val fx: F[X]
val gy: G[Y]