Created
July 20, 2012 05:08
-
-
Save tonymorris/3148800 to your computer and use it in GitHub Desktop.
WTF?
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
trait Functor[F[_]] | |
object Functor { | |
implicit val OptionFunctor: Functor[Option] = | |
error("") | |
} | |
case class OptionT[F[+_], +A] | |
object OptionT { | |
implicit def OptionTFunctor[F[+_]](implicit F0: Functor[F]): Functor[({type λ[α] = OptionT[F, α]})#λ] = | |
error("") | |
} | |
trait TTT { | |
// fine | |
val a = implicitly[Functor[Option]] | |
// fine | |
val b = implicitly[Functor[({type lam[+a]=OptionT[Option, a]})#lam]] | |
// not fine | |
val c = implicitly[Functor[({type lam[+a]=OptionT[({type l[+b]=OptionT[Option, b]})#l, a]})#lam]] | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah, that's exactly the point. I will hopefully take a look at it closely soon.