diff --git a/core/src/main/scala/cats/data/Prod.scala b/core/src/main/scala/cats/data/Prod.scala index c50fc321db..202c49a234 100644 --- a/core/src/main/scala/cats/data/Prod.scala +++ b/core/src/main/scala/cats/data/Prod.scala @@ -5,21 +5,10 @@ package data * [[Prod]] is a product to two independent functor values. * * See: [[https://www.cs.ox.ac.uk/jeremy.gibbons/publications/iterator.pdf The Essence of the Iterator Pattern]] - */ -sealed trait Prod[F[_], G[_], A] { - def first: F[A] - def second: G[A] -} -object Prod extends ProdInstances { - def apply[F[_], G[_], A](first0: => F[A], second0: => G[A]): Prod[F, G, A] = new Prod[F, G, A] { - val firstThunk: Eval[F[A]] = Later(first0) - val secondThunk: Eval[G[A]] = Later(second0) - def first: F[A] = firstThunk.value - def second: G[A] = secondThunk.value - } - def unapply[F[_], G[_], A](x: Prod[F, G, A]): Option[(F[A], G[A])] = - Some((x.first, x.second)) -} + */ +final case class Prod[F[_], G[_], A](first: F[A], second: G[A]) + +object Prod extends ProdInstances private[data] sealed abstract class ProdInstances extends ProdInstances0 { implicit def prodAlternative[F[_], G[_]](implicit FF: Alternative[F], GG: Alternative[G]): Alternative[Lambda[X => Prod[F, G, X]]] = new ProdAlternative[F, G] {