Scala course

Scala Level 5: Functional Programming

Functional Programming is level 5 of 13 of the LoWisa Scala course. It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

Updated 2026-11-30

Higher-Order Functions

  • Functions taking functions. Higher-order functions abstract patterns: retry(3)(fetchUser) wraps behaviour around behaviour.
  • Currying. Curried parameter lists specialise functions stepwise: configuration first, data later.
  • Function composition. andThen and compose chain functions: pipelines built from named pieces.

Pure Functions and Immutability

  • Purity. A pure function reads only inputs and changes nothing: same arguments, same answer, testable in isolation.
  • Referential transparency. Referential transparency lets you substitute a call with its value: the property equational reasoning needs.
  • Effects at the edges. Idiomatic Scala keeps side effects at the boundary: a pure core, I/O in a thin shell.

Function Composition

  • Small functions compose. Design as composition: validate andThen enrich andThen price: each step named, tested, reused.
  • for-comprehensions. A for-comprehension chains map and flatMap readably: Options, Eithers and Futures sequenced alike.
  • Pipelines over loops. Scala replaces loop bookkeeping with pipelines: intent stated, indexes deleted.

Before and after this level

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See Checkpoints and flashcards.

Frequently asked questions

What does Scala Level 5: Functional Programming cover?

Higher-Order Functions, Pure Functions and Immutability, Function Composition: 3 lessons and 9 ideas.

What should I know before this level?

The level before it, Level 4: Algebraic Data Types, which covers Enums and Case Classes, Pattern Matching, Modelling Valid States.

Learn Scala on your phone

The first level is free. LoWisa is on Google Play and the App Store.