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

MonoidK

Previously, we saw the version of Monoid that works on all types. A version of Monoid also exists that operates on effect types, that is, on the types of the kind of F[A]. This type class is called MonoidK:

So, as you can see, the method is defined for an effect type, and instead of the combined method that works on two types, A, MonoidK defines a method called combineK, which works on values of type F[A]. Also notice that this method is parametrized by the type A on the method level and not on the level of the type class itself, which means that you can have the single type class defined for some effect type, F[_], and you can use ...

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