Installation of necessary tools/Scala and introduction
- Scala-cli installation
- Scala in InteliJ Idea (Scala plugin)
- What is Scala, a small sample of the aims and direction of the course, also with practical examples
- Creating a project
Basic constructions of the language and an introduction to types
- Mutable vs immutable variables - the immutable principle
- Basic types: numeric, strings, truth values
- Terms and cycles
- For cycle that returns a result, theory of expressions - what is an expression and what is not
- Functions, recursion, tail recursion
- String interpolation
- Tuple type, "breaking" into variables, pattern matching
- Type option as a one-element collection, chaining options in the for loop, Option(null)
- List/Seq/Vector/Set/Map and operations on them
- Mutable variants of containers
Operations on collections
- foreach, map, flatMap
- recursive counting with collections, foldLeft, sum, reduce
- find, headOption, filter, exists, contains, collect, groupBy, mkString
OOP in Scala
- Class and its attributes, constructor, companion object and apply
- case class, copy method, pattern matching
- Traits and multiple inheritance
- Anonymous classes
- sealed trait and enumerations
More advanced constructions of the language
- Higher functions, function as parameter and return value
- When is the code actually called/evaluated?
- Lambdas
- Wrapping primitive values into types instead of using them directly
- implicit functions, conversions
- implicit classes, method addition
- default values
- Try vs try
- Chaining of potentially unsuccessful operations in the for loop, recover, orElse
- Function with type parameter
- Delimitation of types
- Our own reducer
Asynchronous programming
- Futures
- Await.ready/result
- Execution Context (global, fixed thread pool, cached, work stealing pool)
- Future does not mean thread, What is a thread pool
- map, flatMap, folding in the for loop
- andThen, recover, transform
- laziness