Packages

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

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
}
Self Type
Day[F, G, A]
Source
Day.scala
See also

Bartosz Milewski talk, derive Day from multiplying Functors and using Coyoneda

Edward Kmett talk, explains Divisible and Decidable in context of contravariant Day

Phil Freeman blog, connections between Day and Comonads, Comonads transformers, optics

Discussion on Reddit with mention about usage for stream processing and intuition based on liftA2 from Applicative and Day

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Day
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type X
  2. abstract type Y

Abstract Value Members

  1. abstract val fx: F[X]
  2. abstract val gy: G[Y]
  3. abstract def xya: (X, Y) ⇒ A

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. def cobind[B](f: (Day[F, G, A]) ⇒ B): Day[F, G, B]
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. def map[B](f: (A) ⇒ B): Day[F, G, B]
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. def swapped: Day[G, F, A]

    Swap type constructors order

  18. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. def trans1[H[_]](nat: ~>[F, H]): Day[H, G, A]

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

  21. def trans2[H[_]](nat: ~>[G, H]): Day[F, H, A]

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

  22. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped