Advertisement
Guest User

Untitled

a guest
Jul 30th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. val list1 = List("This", "is", "an", "example");
  2.  
  3. val b = list1.aggregate(1)(_ * _.length(), _ * _)
  4.  
  5. val c = list1.aggregate(1)(_ * _.length(), _ + _)
  6.  
  7. def aggregate[B](z: ⇒ B)(seqop: (B, A) ⇒ B, combop: (B, B) ⇒ B): B
  8.  
  9. val l = List(1, 2, 3, 4)
  10. l.aggregate(0)(_ + _, _ * _)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement