4

Writing Testable Code with Pure Functions

When you read about functional programming, quite often, what is meant is “pure” functional programming. As we touched on in the first chapter, this is not a strict requirement of functional programming or functional languages. If you decide to pick up a functional programming language, the chances are pretty high that you’ll pick up a language such as Haskell or Elm. If so, you would have chosen two purely functional languages and might have coupled your understanding of pure functional with functional. On the other hand, if you had picked up a language such as Lisp, Clojure, or Erlang, you would have picked a functional language that is impure yet still functional.

In this chapter, we will address ...

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.