Skip to content

Instantly share code, notes, and snippets.

@b-studios
Created January 17, 2017 15:29
Show Gist options
  • Save b-studios/5ddd3a840b52fb52d0aeb9823d5fa62c to your computer and use it in GitHub Desktop.
Save b-studios/5ddd3a840b52fb52d0aeb9823d5fa62c to your computer and use it in GitHub Desktop.
Typeconstructor equivalence
object tc {
sealed trait =::=[F[_], G[_]] {
def apply[A](f: F[A]): G[A]
}
object =::= {
implicit def idFunctors[F[_]]: F =::= F = new =::=[F, F] {
def apply[A](f: F[A]): F[A] = f
}
}
type Id[A] = A
type SomeotherId[A] = A
implicitly[Id =::= SomeotherId]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment