Created
March 23, 2016 07:53
-
-
Save eamelink/a70df85535eee3ab56dd to your computer and use it in GitHub Desktop.
This file contains hidden or 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 cats.data.Coproduct | |
import cats.free.Inject | |
object CoproductInject { | |
trait A[T] | |
trait B[T] | |
trait C[T] | |
type Two[T] = Coproduct[A, B, T] | |
val IA = implicitly[Inject[A, Two]] // Works | |
val IB = implicitly[Inject[B, Two]] // Works | |
type Three[T] = Coproduct[Two, C, T] | |
val IAT = implicitly[Inject[A, Three]] // Doesn't work | |
val IBT = implicitly[Inject[B, Three]] // Doesn't work | |
val ICT = implicitly[Inject[C, Three]] // Works | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment