Last active
March 31, 2016 18:24
-
-
Save bigjason/240f6cfdbbedf8f4bf513f6ee76cc847 to your computer and use it in GitHub Desktop.
How the hell is `scala.util.Try` missing a `zip` function?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This is free and unencumbered software released into the public domain. | |
*/ | |
implicit class RicherTry[+T](wrapped: Try[T]) { | |
def zip[That](that: => Try[That]): Try[(T, That)] = | |
for (a <- wrapped; b <- that) yield (a, b) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment