Trait/Object

scalaz

Day

Related Docs: object Day | package scalaz

Permalink

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

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

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

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

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

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

    Permalink
  2. abstract type Y

    Permalink

Abstract Value Members

  1. abstract val fx: F[X]

    Permalink
  2. abstract val gy: G[Y]

    Permalink
  3. abstract def xya: (X, Y) ⇒ A

    Permalink

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. def cobind[B](f: (Day[F, G, A]) ⇒ B): Day[F, G, B]

    Permalink
  7. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  12. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  13. def map[B](f: (A) ⇒ B): Day[F, G, B]

    Permalink
  14. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. def swapped: Day[G, F, A]

    Permalink

    Swap type constructors order

  18. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  19. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  20. def trans1[H[_]](nat: ~>[F, H]): Day[H, G, A]

    Permalink

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

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

    Permalink

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

  22. final def wait(): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped