Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Functional effect handling in Scala with Cats Effect
Rating: 4.5 out of 5(149 ratings)
978 students

Functional effect handling in Scala with Cats Effect

A peek on how functional programming experts deal with side effects
Created byLeandro Galvan
Last updated 9/2022
English
English [Auto],

What you'll learn

  • Model and compose effectful computations in a pure manner.
  • Design an error handling strategy taking side-effects into consideration.
  • Increase concurrency and parallelism of an application with high-level methods.
  • Safely use and release resources such as connections, io streams, etc.
  • Handle complex concurrent scenarios involving shared state and thread communication with purely functional primitives.

Course content

14 sections81 lectures7h 11m total length
  • Introduction3:46

    Learn to model and compose effects in scala using the catafalque library, describe effects before execution, design robust error handling, safe concurrency, and safe resource release.

  • Setting up environment2:23

    Set up your Scala environment for functional effect handling with Cats Effect by creating a project, adding a build file, and configuring source and worksheet workflows.

  • How to take this course0:40
  • Course files0:10

Requirements

  • Working knowledge of the Scala language (case classes, pattern matching, traits, implicits, etc.)
  • (Helpful) Knowledge of functional typeclasses such as Monads, Applicatives and Functors
  • (Helpful) Some experience with the Cats library

Description

When you first hear about functional programming you might get the impression that it can only be used in toy examples or for very academic purposes. After all, FP is all about purity and almost every useful thing you can do in a program is impure: http calls, file IO, and so on.

In this course I'm going to show you that FP is actually amazing for dealing with effects. By separating program description from execution you will be able to build computations that are easy to compose and reason about, while at the same time keeping all the usefulness of side-effects.

In order to do so, we are going to use the amazing Cats Effect library, which provides an IO monad to model our effects, a very rich API to compose them, and a highly-performant runtime to execute them.

The course is structured in many small/medium sized sections that focus on one specific topic. At the end of each section there is a final exercise to practice what you learned, and a quiz to help check your recall and understanding of the section.

By the end of the course, you will be able to:

  • Write and compose computations you want to run, before actually running them.

  • Design an error handling strategy for your application, taking side-effects into consideration.

  • Increase the parallelism and concurrency of your programs without the need to handle low-level details.

  • Use and compose resources that need to be released (connections, io streams, etc.) in an elegant manner.

  • Handle complex scenarios involving concurent shared state and thread communication by using purely functional primitives.

Hopefully, you will also have some fun along way!

Who this course is for:

  • Scala developers with some experience in functional programming