Guest User

Untitled

a guest
May 26th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. class Subject[T](sub: T) {
  2. def of[R](f: => T => R) = f(sub)
  3. }
  4. implicit def some2subject[T](some: T) = new Subject(some)
  5.  
  6. // 2 of List(1,2,3,4) //-> 3
Add Comment
Please, Sign In to add comment