Jump to ratings and reviews
Rate this book

Learning Functional Programming in Go

Rate this book
Function literals, Monads, Lazy evaluation, Currying, and more About This Book - Write concise and maintainable code with streams and high-order functions - Understand the benefits of currying your Golang functions - Learn the most effective design patterns for functional programming and learn when to apply each of them - Build distributed MapReduce solutions using Go Who This Book Is For This book is for Golang developers comfortable with OOP and interested in learning how to apply the functional paradigm to create robust and testable apps. Prior programming experience with Go would be helpful, but not mandatory. What You Will Learn - Learn how to compose reliable applications using high-order functions - Explore techniques to eliminate side-effects using FP techniques such as currying - Use first-class functions to implement pure functions - Understand how to implement a lambda expression in Go - Compose a working application using the decorator pattern - Create faster programs using lazy evaluation - Use Go concurrency constructs to compose a functionality pipeline - Understand category theory and what it has to do with FP In Detail Functional programming is a popular programming paradigm that is used to simplify many tasks and will help you write flexible and succinct code. It allows you to decompose your programs into smaller, highly reusable components, without applying conceptual restraints on how the software should be modularized. This book bridges the language gap for Golang developers by showing you how to create and consume functional constructs in Golang. The book is divided into four modules. The first module explains the functional style of programming; pure functional programming (FP), manipulating collections, and using high-order functions. In the second module, you will learn design patterns that you can use to build FP-style applications. In the next module, you will learn FP techniques that you can use to improve your API signatures, to increase performance, and to build better Cloud-native applications. The last module delves into the underpinnings of FP with an introduction to category theory for software developers to give you a real understanding of what pure functional programming is all about, along with applicable code examples. By the end of the book, you will be adept at building applications the functional way. Style and approach This book takes a pragmatic approach and shows you techniques to write better functional constructs in Golang. We'll also show you how use these concepts to build robust and testable apps.

672 pages, ebook

Published November 24, 2017

21 people are currently reading
24 people want to read

About the author

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
3 (25%)
4 stars
2 (16%)
3 stars
1 (8%)
2 stars
4 (33%)
1 star
2 (16%)
Displaying 1 - 2 of 2 reviews
371 reviews77 followers
November 21, 2022
I don't want to demotivate the Author, he is very intelligent and familiar with many areas, and I hope he keeps writing and will surely become a great writer.

Unfortunately this book was a rough start. I've probably read ~ 100 programming books over the years, and this was by far the worst.

The title is "Learning Functional Programming in Go" and I took that to mean "Learn to apply functional programming concepts in Go".

The catch is that Go isn't really a functional programming language. So rather than just focusing on what Go can do, and how in many situations functional programming concepts can improve your code performance or maintainability, we get 600 pages of complaints that Go isn't Haskell, that it still doesn't have Tail Call Optimization (to speed up recursive function calls) and no generics (though go does have generics now) and generally contrived, dull, and ugly examples of trying to shoehorn Haskell or other FP oriented thoughts directly into Go. And you also get a lot of Haskell code in case that's why you bought a Go book...

If you really want to master functional programming, you probably should learn about it in one of the languages best suited for FP like Haskell or Scala.

I also don't appreciate the fervor the author conveys on behalf of FP. There are many ways of thinking about and solving each problem. Ultimately even the not cost constrained solution is a balance of 1) code readability 2) code extensibility 3) performance. You choose the right tool and the right paradigm for the job. Unfortunately the author is so focused on making us into FP Zealots, he fails completely at showing us classes/types of real world problems where procedural or object oriented paradigms perform better, thus we end the book not knowing where FP concepts are really most applicable in Go.
Displaying 1 - 2 of 2 reviews

Can't find what you're looking for?

Get help and learn more about the design.