Essential Effects

How to safely create, compose, and execute effectful Scala programs using the Typelevel `cats-effect` library.

Side-effects are a huge source of errors in our programs. Mutable state can change without our knowledge, and concurrency can obfuscate how our programs will execute at runtime. At the same time, built-in solutions like scala.concurrent.Future are problematic because they are eagerly evaluated, and thus we cannot effectively reason about them (that is, they are not referentially transparent).

In contrast, an effect separates the description of a computation from its execution: effects are values that can be safely composed and reasoned about. Essential Effects teaches how to safely create, compose, and execute effectful programs using the Typelevel cats-effect library, and how to integrate these concepts and techniques into your projects.

Objectives

  • Encapsulate side-effects into a safer form, allowing them to be easily combined.
  • Learn how to run multiple tasks in parallel, like a scatter-gather pattern.
  • Integrate callback-based code, like scala.concurrent.Future, into a safer, effect-based interface.
  • Fork independent work into concurrent tasks, then cancel or join them.
  • Learn how to separate CPU-bound work from blocking, IO-bound work.
  • Build and combine resource-leak-proof dependencies for applications.
  • Learn how to test code that performs multiple effects like concurrency and I/O.

Requirements

To benefit from this course you should have about a year’s experience with Scala, or equivalent experience with a functional language such as Haskell, OCaml, or Lisp.

Timeframe

The course consists of two three-hour sessions, scheduled over two days.

Register for our course or check our upcoming events calendar: