All Downloads are FREE. Search and download functionalities are using the official Maven repository.

aecor.data.PairE.scala Maven / Gradle / Ivy

There is a newer version: 0.19.0
Show newest version
package aecor.data

/**
  * Existential pair of type constructors.
  */

sealed abstract class PairE[F[_], G[_]] {
  type A
  def first: F[A]
  def second: G[A]
}

object PairE {
  def apply[F[_], G[_], A](fa: F[A], ga: G[A]): PairE[F, G] = {
    type A0 = A
    new PairE[F, G] {
      final override type A = A0
      final override def first: F[A0] = fa
      final override def second: G[A0] = ga
      override def toString: String = s"Pair($first, $second)"
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy