Skip to content

Instantly share code, notes, and snippets.

@djspiewak
Created July 5, 2019 18:06
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 djspiewak/ac3662db943425899f0b7c67b0609b77 to your computer and use it in GitHub Desktop.
Save djspiewak/ac3662db943425899f0b7c67b0609b77 to your computer and use it in GitHub Desktop.
def flatMap2[F[_]: Monad, A, B, C](fa: F[A], fb: F[B])(f: (A, B) => F[C]): F[C] =
fa.flatMap(a => fb.flatMap(b => f(a, b)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment