Slide 1

Slide 1 text

How to write like cats

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

What we won’t be talking about What we will be talking about ● Category theory ● Monads, Monoids, Functors etc. ● Effect types ● Polymorphism ● Type classes ● Implicits

Slide 4

Slide 4 text

Subtype polymorphism

Slide 5

Slide 5 text

Subtype polymorphism ↓ Ad-hoc Polymorphism (Type classes)

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

Live coding! github.com/MontyWest/tech-talk-typeclass

Slide 8

Slide 8 text

Type Classes ● Can add functionality to types you don’t ‘own’. ● Can change functionality in different scopes. ● Higher level of abstraction, composability and applicability. ● Enables library like Cats, allows others to do your work for you!

Slide 9

Slide 9 text

Links to follow ● Typelevel Cats: https://typelevel.org/cats/ ● Typelevel blog: https://typelevel.org/cats/typeclasses.html ● Talks: ○ Petra Bierleutgeb, Polymorphism in Scala: https://www.youtube.com/watch?v=-SA1Ui283Qc ○ Rob Norris, ScalaX keynote: https://skillsmatter.com/skillscasts/11626-keynote- pushing-types-and-gazing-at-the-stars

Slide 10

Slide 10 text

Thanks for listening! Any Questions?