Last active
December 11, 2015 18:48
-
-
Save julienrf/4644155 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
| /** | |
| * data (f :+: g) a = Inl (f a) | Inr (g a) | |
| */ | |
| sealed trait Coproduct[F[+_], G[+_], A] | |
| case class Inl[F[+_], G[+_], A](a: F[A]) extends Coproduct[F, G, A] | |
| case class Inr[F[+_], G[+_], A](a: G[A]) extends Coproduct[F, G, A] | |
| trait :+:[F[+_], G[+_]] { | |
| type Apply[A] = Coproduct[F, G, A] | |
| } | |
| // --- Example of usage | |
| // How to get rid of the `#Apply` thing? | |
| val foo: (List :+: Option)#Apply[Int] = ??? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment