Skip to Content
Mastering Functional Programming
book

Mastering Functional Programming

by Anatolii Kmetiuk
August 2018
Intermediate to advanced
380 pages
10h 2m
English
Packt Publishing
Content preview from Mastering Functional Programming

Type class hierarchy

The first thing to notice here is that the type classes are defined in the format that we saw in the previous chapter. Another thing to notice is the hierarchy of type classes in the Cats library. So, for example, the Monad class extends the FlatMap and Applicative type classes, and if you take a look at the linear super types of the type class, you will see that the ancestors are far more numerous. Also, if you have a look at the subclasses, you will notice that a number of type classes also extend the Monad type class.

The reason for this hierarchy is that the Cats library is quite fine-grained. We previously discussed that type classes can be treated as containers for methods that you're going to use. Type classes ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Functional Programming

Learning Functional Programming

Jack Widman

Publisher Resources

ISBN: 9781788620796Supplemental Content