Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val list1 = List("This", "is", "an", "example");
- val b = list1.aggregate(1)(_ * _.length(), _ * _)
- val c = list1.aggregate(1)(_ * _.length(), _ + _)
- def aggregate[B](z: ⇒ B)(seqop: (B, A) ⇒ B, combop: (B, B) ⇒ B): B
- val l = List(1, 2, 3, 4)
- l.aggregate(0)(_ + _, _ * _)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement