Guest User

Untitled

a guest
Dec 12th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. def a(x: Int): Option[Int] = {
  2. println(x)
  3. Some(x+1)
  4. }
  5.  
  6. def stop(x: Int): Option[Int] = {
  7. println(x)
  8. None
  9. }
  10.  
  11. a(1)
  12. .map(a)
  13. .map(a)
  14. .map(a)
  15. .map(stop)
  16. //Do not execute further
  17. .map(a)
  18. .map(a)
Add Comment
Please, Sign In to add comment