Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def map2[A, B, C](firstValue: Option[A], secondValue: Option[B])(function: (A, B) => C): Option[C] = (firstValue, secondValue) match {
- case (Some(a), Some(b)) => Some(function(a, b))
- case _ => None()
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement