Chapter 8: A Beginner's Tutorial To Using Scala's Collection Functions

By Nadim Bahadoor | Last updated: February 5, 2020 at 12:39 pm

In this section, we will go over how to use the rich set of Collection Functions that the Scala programming language provides.

 

Feel free to review Chapter 6 on Scala's Immutable Collection and Chapter 7 on Scala's Mutable Collection as we will be making use of these collections throughout this chapter.

 

Throughout the tutorials we will use the popular IntelliJ IDEA which we've setup in Chapter 1. I hope that by now you are more comfortable using IntelliJ. If not, feel free to review the previous tutorials from Chapter 1!

 

In this chapter, we will provide tutorials on the topics below. If none of these make any sense right now, that's OK :)

 

So let's get started!

 

Function aggregate Function collect Function diff
Function drop Function dropWhile Function exists
Functions filter & filterNot Function find Function flatMap
Function flatten Function fold Function foldLeft
Function foldRight Function foreach Function groupBy
Function head Function isEmpty Function intersect
Function last Function map Function max
Function maxBy Function min Function minBy
Function mkString Function nonEmpty Function par
Function partition Function reduce Function reduceLeft
Function reduceRight Function reverse Function reverseIterator
Function scan Function scanLeft Function scanRight
Function size Function slice Function sortBy
Function sorted Function sortWith Function tail
Function take Function takeRight Function takeWhile
Function transpose Function union Function unzip
Function unzip3 Function view Function withFilter
Function zip Function zipWithIndex Function par 2.13

 

Nadim Bahadoor on FacebookNadim Bahadoor on GithubNadim Bahadoor on LinkedinNadim Bahadoor on Twitter
Nadim Bahadoor
Technology and Finance Consultant with over 14 years of hands-on experience building large scale systems in the Financial (Electronic Trading Platforms), Risk, Insurance and Life Science sectors. I am self-driven and passionate about Finance, Distributed Systems, Functional Programming, Big Data, Semantic Data (Graph) and Machine Learning.