TypeLevel Cats
Imagine toString
, equals
, and hashCode
in a single class. Can you change implementations on the spot? Probably not, there may be too many dependencies on your implementation. Time to break out an adapter pattern, a utility class, or better yet, a type class! A type class is a kind of template in very static functional programming languages. Imagine a template that can read, write information as a side effect as well? Type classes are powerful.
For these various type-classes, we will be looking at a project called TypeLevel Cats. TypeLevel is a group of projects that adhere to a code of conduct, modular systems, static, functional, open-source programming. TypeLevel Cats is the flagship project for Typelevel.
Our presentation will be following this story:
-
Just a tiny bit of Scala
-
Introduction to an implicit
-
Introduction to a typeclass
-
Using Cats
-
Eq
-
Monoid
-
Monad
-
Functors
Even if you are not a Scala Programmer, you may want to come in and see how type classes work because I am making a bet… This will be something that will be used by other JVM languages in the future. Kotlin doesn’t have it now, Groovy doesn’t have it now, TypeScript doesn’t either although some projects are working towards this idea.