9

Functional Design Patterns

In this chapter, we will move to a higher level of abstraction. Rather than talking about individual functions and operations, let’s take a look at some design patterns. While we will not extensively explain each design pattern, we will take a look at how the object-oriented pattern translates to the functional world.

In this chapter, we’re going to cover the following main topics:

  • Classical design patterns in a functional paradigm:
    • The strategy pattern
    • The decorator pattern
    • The Hollywood principle
  • Functional design patterns

Technical requirements

In this chapter, any version at or above Go 1.18 will work for all Go-related code. Some snippets are written in Java; those will work with any version of Java above 1.5. ...

Get Functional Programming in Go 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.