Skip to content

Instantly share code, notes, and snippets.

@milessabin
Last active March 29, 2019 15:55
Show Gist options
  • Save milessabin/f808aead2b67b56fd733b2d6e8b7a2ca to your computer and use it in GitHub Desktop.
Save milessabin/f808aead2b67b56fd733b2d6e8b7a2ca to your computer and use it in GitHub Desktop.
object Utils {
type Id[t] = t
type Const[c] = [t] => c
}
import Utils._
class Instances[F[_[_]], T[_]]
trait Functor[F[_]]
object Functor {
implicit val functorId: Functor[Id] = ???
implicit def functorGen[F[_]](implicit inst: Instances[Functor, F]): Functor[F] = ???
implicit def functorConst[T]: Functor[Const[T]] = ???
}
case class Sm[A](value: A)
object Sm {
implicit def smInstances[F[_[_]]]: Instances[F, Sm] = ???
}
object Test {
implicitly[Functor[Sm]]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment