Overview
Explore functional programming concepts and their application in Go during this GopherCon 2020 talk. Discover the benefits of functional programming and learn how to implement closures, currying, tail-recursion, and other techniques to solve real-world problems. Compare functional approaches to traditional methods, and gain insights into useful libraries that streamline functional Go programming. Delve into topics such as immutable functions, pure functions, side effects, idempotence, first-class and higher-order functions, and recursion. Examine practical use cases, including reducing function parameters and implementing server options. Investigate declarative programming, code generation, and potential drawbacks of functional programming in Go.
Syllabus
Intro
When people think of FP...
Misconceptions?
Why FP?
A gentle introduction
Say what, not how
Immutable functions
Pure function vs side-effect
Idempotence
First-class / higher-order functions
Recursion vs Tail Recursion
Up Next... Closures
Currying Function with 1 parameter, returning Closure
Practical use-case: Reduce function params
Server Options Example
Defining Options
Constructor
Default Options
Declarative Programming?
Hasgo
Generating functions
Generated Code
Code Generation Example
Add your own!
Some drawbacks..
Taught by
Gopher Academy