Guest User

Untitled

a guest
Dec 16th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. def mulBy(by: Int)(x: Int) = x * by
  2. val list = List(1, 2, 3)
  3.  
  4. // doesn't work
  5. List(1, 2, 3).map(mulBy)(1)
  6.  
  7. // works
  8. val x = List(1, 2, 3).map(mulBy)
  9. val y = x(1)
  10.  
  11. // works
  12. (List(1, 2, 3).map(mulBy) _)(1)
  13.  
  14. // Why?
Add Comment
Please, Sign In to add comment