Skip to content

Instantly share code, notes, and snippets.

@mmenestret
Created June 4, 2019 10:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmenestret/bcd535c9a84c33d627786d1279f6311d to your computer and use it in GitHub Desktop.
Save mmenestret/bcd535c9a84c33d627786d1279f6311d to your computer and use it in GitHub Desktop.
implicit class InfixMappable[A, B, C](f: A => B) {
def `<$>`[G[_]: Functor](ga: G[A]): G[B] = Functor[G].map(ga)(f)
}
val ap1: Option[Int] = ???
val ap2: Option[Int] = ???
val ap3: Option[Int] = ???
val f: Int => Int => Int => Int = ???
f `<$>` ap1 ap ap2 ap ap3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment