Skip to content

Instantly share code, notes, and snippets.

@tonymorris
Created July 20, 2012 05:08
Show Gist options
  • Save tonymorris/3148800 to your computer and use it in GitHub Desktop.
Save tonymorris/3148800 to your computer and use it in GitHub Desktop.
WTF?
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]]
}
@tonymorris
Copy link
Author

Yeah, that's exactly the point. I will hopefully take a look at it closely soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment