Skip to content

Instantly share code, notes, and snippets.

@vhutov
Created June 23, 2020 22:39
Show Gist options
  • Save vhutov/b0563ae1d69c99df75f469fa2ba00843 to your computer and use it in GitHub Desktop.
Save vhutov/b0563ae1d69c99df75f469fa2ba00843 to your computer and use it in GitHub Desktop.
Functor + Inject
implicit class InjectableFunctor[F[_], A](fa: F[A]) {
def inj[B](implicit F: Functor[F], I: Inject[A, B]): F[B] = {
fa.map(I.inj)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment