Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import scala.language.higherKinds
class Cartesian[F[_]] {
trait Arbitrary1
trait Arbitrary2
implicit val fa1: F[Arbitrary1] = null.asInstanceOf
implicit val fa2: F[Arbitrary2] = null.asInstanceOf
class QED
implicit def proof(implicit fa12: F[(Arbitrary1, Arbitrary2)]): QED = null
}
trait Foo[T]
object Foo {
implicit def pair[A, B](implicit fa: Foo[A], fb: Foo[B]): Foo[(A, B)] = new Foo[(A, B)] {}
}
object Test {
object FooIsCartesian extends Cartesian[Foo]
def test(implicit fc: FooIsCartesian.QED): Unit = ()
test
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.