Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. class Function[X, Y] {
  2. def apply(x: X): Y
  3. }
  4.  
  5. class Foo {
  6. def bar(x: Int): String
  7. }
  8.  
  9. val f = foo.bar(_)
  10.  
  11. val f = new Function[Int, String] {
  12. def apply(x: Int) = foo.bar(x)
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement