Functional Type Classes

Learn what type classes are and how to use them, and explore common and powerful type classes in functional Scala.

Book a Training

Overview

Haskell inspired much functional programming in Scala, including the well-known libraries Cats and Scalaz. Yet much of this machinery, which has its roots in category theory, remains confusing to most Scala developers, which limits the ability of developers to use functional libraries and functional abstractions in their applications.

In this course, developers will learn what type classes are, and how to use them, and then systematically explore more than a dozen different standard type classes that appear across many different programming languages, including Scala, Kotlin, and Haskell. By the end of the course, developers will understand which type classes are useful to solve which types of problems, as well as possess the skills necessary to decipher new type classes they haven’t seen before.

Are you interested in attending a private training course?

Register for Private Training

Are you interested in attending a public training course?

Register for Public Training

Who Should Attend

Scala developers who struggle to understand type classes and functional abstractions like monads, comonads, applicative functors, and the like.

Prerequisites

Good working knowledge of Scala, including familiarity with immutable data, pattern matching, and basic recursion. Developers who have attended Functional Scala Foundations will be well-prepared for this course.

Topics

  • A brief introduction to generics & higher-kinded generics
  • Type classes & their encoding in Scala
  • Implementing type classes for custom data types
  • Implementing type classes for custom generic data types
  • Standard type classes for ordering, equality, & debugging
  • The abstract algebra hierarchy
  • The functor hierarchy, including applicative and monad
  • Dual abstractions, such as comonads
  • Collection type classes, including Traverse and Foldable
  • Exotic functors, such as contravariant, invariant, and selectable
  • Profunctors and arrows
  • Bifunctors
  • Higher-order monoids and semigroups
TESTIMONIAL
Last year, we started using ZIO, as a superior alternative to tagless-final and Monad transformers. ZIO is a powerful effect monad with a lot of combinators, interop with important libraries, and new integrations with OpenTracing and logging. ZIO lets us focus on our business logic, making it easier to understand and test, and there is no doubt ZIO will be one of the significant parts of Scala infrastructure over the coming years!
Jan de Groot
DHL Parcel Netherlands - Head of Development

Related Courses

A Crash Course in Functional Scala

Learn how functional Scala enables you to write better code, with high productivity and testability.

# fp
24 hours

Functional Design

Learn how to benefit from functional programming techniques across your application, in a way that’s highly accessible to the whole team and new hires.

# fp
24 hours

Functional Effects

Learn how to solve complex problems in asynchronous, concurrent programming using the ZIO library.

# fp
24 hours

Book a Training