implicit class TryWithForNot[T](t: Try[T]) {
def fornot[A](f: Throwable => A): Unit = ???
}
implicit class SuccessWithForNot[T](success: Success[T]) {
def fornot[A](f: Throwable => A): Unit = ()
}
implicit class FailureWithForNot[T](failure: Failure[T]) {
def fornot[A](f: Throwable => A): Unit = {
f(failure.exception)
()
}
}
Last active
November 15, 2017 23:28
-
-
Save jamesward/77fef330919743f81e48a44f05c02819 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment