Guest User

Untitled

a guest
Nov 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. ```scala
  2. implicit class TryWithForNot[T](t: Try[T]) {
  3. def fornot[A](f: Throwable => A): Unit = ???
  4. }
  5.  
  6. implicit class SuccessWithForNot[T](success: Success[T]) {
  7. def fornot[A](f: Throwable => A): Unit = ()
  8. }
  9.  
  10. implicit class FailureWithForNot[T](failure: Failure[T]) {
  11. def fornot[A](f: Throwable => A): Unit = {
  12. f(failure.exception)
  13. ()
  14. }
  15. }
  16. ```
Add Comment
Please, Sign In to add comment