Created
June 23, 2020 22:39
-
-
Save vhutov/b0563ae1d69c99df75f469fa2ba00843 to your computer and use it in GitHub Desktop.
Functor + Inject
This file contains 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
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