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

Abstract methods

Let's take a look at the value member section of the Scaladoc documentation of the Monad implementation by Cats. The abstract members section is the most important section of any type cause definition. A type class is a declaration of certain tools, and its concrete instances must support these tools. They are declared, but not implemented in the type class trait. So, the abstract methods defined by a type class constitute a definition of this type class.

Concretely, in the case of Monad, we have three abstract methods, as follows:

  • There is a flatMap method, which we are already familiar with.
  • The pure method is able to lift any value into an effect type of F.
  • There is a tailRecM and type class. It is a tail recursive Monadic ...
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