Skip to content

Instantly share code, notes, and snippets.

@afsalthaj
Last active June 15, 2021 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afsalthaj/f91e1ea7e6801dc91f9b328e6a12367b to your computer and use it in GitHub Desktop.
Save afsalthaj/f91e1ea7e6801dc91f9b328e6a12367b to your computer and use it in GitHub Desktop.
trait ContraVariantFunctor[F[_]] {
def contramap[A, B](f: B => A): F[B]
def xmap[A, B](fa: F[A], f: A => B, g: B => A): F[B] =
contramap(fa, g)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment