Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.21 KB | None | 0 0
  1. def map2[A, B, C](firstValue: Option[A], secondValue: Option[B])(function: (A, B) => C): Option[C] = (firstValue, secondValue) match {
  2.     case (Some(a), Some(b)) => Some(function(a, b))
  3.     case _ => None()
  4. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement