-
-
Save tonymorris/8294908 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
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