Skip to content

Instantly share code, notes, and snippets.

@tonymorris
Forked from markhibberd/blah.scala
Last active January 2, 2016 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonymorris/8294908 to your computer and use it in GitHub Desktop.
Save tonymorris/8294908 to your computer and use it in GitHub Desktop.
object blah {
case class OptionT[F[_], A](x: F[Option[A]])
trait Functor[F[_]]
object Functor {
implicit val OptionFunctor: Functor[Option] =
sys.error("todo")
}
object OptionT {
implicit def OptionTFunctor[F[_]: Functor]: Functor[({ type l[a] = OptionT[F, a] })#l] =
sys.error("todo")
}
case class Writer[W, A](w: W, a: A)
object Writer {
implicit def WriterFunctor[W]: Functor[({ type l[a] = Writer[W, a] })#l] =
sys.error("todo")
}
type WWW[A] = Writer[String, A]
type OOO[A] = OptionT[WWW, A]
implicitly[Functor[WWW]]
implicitly[Functor[OOO]]
implicitly[Functor[({ type l[a] = Writer[String, a] })#l]]
implicitly[Functor[({ type l[a] = OptionT[Option, a] })#l]]
// implicitly[Functor[({ type l[a] = OptionT[WWW, a] })#l]]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment