Created
September 14, 2017 21:08
-
-
Save milessabin/bad6ab9e72c06813b8f80ecf3e1e7772 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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