Book Image

Learning Functional Programming in Go

By : Lex Sheehan
Book Image

Learning Functional Programming in Go

By: Lex Sheehan

Overview of this book

Lex Sheehan begins slowly, using easy-to-understand illustrations and working Go code to teach core functional programming (FP) principles such as referential transparency, laziness, recursion, currying, and chaining continuations. This book is a tutorial for programmers looking to learn FP and apply it to write better code. Lex guides readers from basic techniques to advanced topics in a logical, concise, and clear progression. The book is divided into four modules. The first module explains the functional style of programming: pure functional programming, manipulating collections, and using higher-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, increase performance, and build better cloud-native applications. The last module covers Category Theory, Functors, Monoids, Monads, Type classes and Generics. By the end of the book, you will be adept at building applications the FP way.
Table of Contents (21 chapters)
Title Page
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Index

A note about Go Dependency Management


At the time this book was written, Glide was the best choice to handle Go dependencies. The How to build and run Go projects section discusses its use in detail.

 

Since then, two new, more widely accepted Go dependency management solutions have emerged: dep and vgo.

 

Note

You can find more information about dep at https://github.com/golang/dep. You can find more information about vgo at https://github.com/golang/go/wiki/vgo.

 

 

Glide was deprecated in favor of dep, and dep will be replaced by vgo.

 

As of today, at the time of our book revision (June 2018), I would recommend using dep, but I would recommend using vgo when Go 1.11 is released.

 

Note

Go versions can be found at https://golang.org/doc/devel/release.html. Go 1.10 was released on 2018/02/16. Go is released every 6 months.

 

 

As far as I know, relative package imports are not supported in dep or vgo.

 

If you decide to replace Glide with either dep or vgo, the relative references to project packages like...