10 Monoids

This chapter covers

  • Using purely algebraic structures
  • Understanding monoids and fold operations
  • Using balanced folds to perform parallel computations in chunks
  • Higher-kinded types and foldable data structures
  • Composing monoids to perform complex calculations

By the end of part 2, we were getting comfortable considering data types in terms of their algebras. In particular, we were concerned with the operations they support and the laws that govern those operations. By now, you will have noticed that the algebras of very different data types tend to share specific patterns in common. In this chapter, we begin identifying these patterns and taking advantage of them.

This chapter is our first introduction to purely algebraic structures ...

Get Functional Programming in Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.