Concrete methods
Besides abstract methods, the Monad type class provides a bunch of predefined concrete value members. These are implemented by default in the type class, so when you define the type class instance, you do not need to provide the implementation of these value members. Their definitions are based on the abstract value members that we saw previously. This means that every method that you encounter under concrete value members can be defined in terms of the abstract value members we saw previously.
It is very common for concrete value members to contain methods that are abstract value members in a superclass of the type class in question. Take, for example, the map method, which we are already familiar with. Technically, it comes ...
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.
Read now
Unlock full access