HDTutorial
EN

Playback starts YouTube’s embedded player (privacy-enhanced mode).

The Parallel typeclass in Cats - Scala tutorial

4,314 views September 27, 2020 12:39

Watch on YouTube
ChannelJakub Kozłowski

Chapters

Description from the creator

In this video, you'll learn about the Parallel typeclass: what problem it solves, how it's implemented in Cats, and how it can be used in your programs. You'll also see what the relationship between Either and Validated is and why they are distinct types.

If you liked the video, please like and subscribe!

Examples (mostly non working snippets, but could help for copy-pasteability): github.com/kubukoz/videos/blob/master/parallel/…

Table of contents:

0:00 - Introduction, a bit of history
0:51 - Case study: Either accumulation
4:01 - Case study: IO parallelism
5:31 - Looking for a common abstraction
6:42 - Possible solution: Applicative?
7:15 - The problem with Applicative
7:48 - Introducing Parallel
10:57 - Final result
11:31 - NonEmptyParallel
12:08 - Summary, parting words

If you want more:
Parallel documentation: typelevel.org/cats/typeclasses/parallel.html
IO parallelism: typelevel.org/cats-effect/datatypes/io.html#par…
Validated documentation: typelevel.org/cats/datatypes/validated.html - in there you'll find withEither, which is another way of temporarily converting Validated to Either.Either, Validated, and Parallel (blog) - timushev.com/posts/2019/09/24/either-validated-…
Why Parallel (blog) - meta.plasm.us/posts/2019/09/11/why-parallel/

About this tutorial

Jakub Kozłowski published this 12:39 video tutorial on September 27, 2020. It has been watched 4,314 times on YouTube.

Duration
12:39
Published
September 27, 2020
Views
4,314
Likes
257

Tags

Share

This tutorial in other languages