~/talk

Functional Programming with Go

Talkat GopherCon 2020 · 2020-11-09..11-13· [functional-programming, go]
links:none on file
slides:none on file

Argues that Go can use functional ideas — closures, currying via closures, tail recursion and pure functions — to get safer, more testable code while noting tradeoffs: no generics (workaround via code generation), no tail-call optimization, and extra hidden loops hurting hot paths. Demonstrates libraries like gleam, pi and hasgo, shows a concrete hasgo-generated pipeline (inRange → abs → filter(isEven) → sum) that returns sum equals 60, and a real example generating movies pipelines (filter, nub, take, map) with options-style constructors that work but may not be idiomatic or fastest.

AI-written summary · about

  1. 0:00Intro
  2. 0:54When people think of FP...
  3. 2:06Misconceptions?
  4. 4:12Why FP?
  5. 6:23A gentle introduction
  6. 7:18Say what, not how
  7. 8:31Immutable functions
  8. 10:48Pure function vs side-effect
  9. 13:05Idempotence
  10. 15:08First-class / higher-order functions
  11. 17:03Recursion vs Tail Recursion
  12. 20:00Up Next... Closures
  13. 21:30Currying Function with 1 parameter, returning Closure
  14. 25:06Practical use-case: Reduce function params
  15. 26:00Server Options Example
  16. 26:42Defining Options
  17. 27:43Constructor
  18. 29:03Default Options
  19. 29:59Declarative Programming?
  20. 32:02Hasgo
  21. 34:19Generating functions
  22. 35:22Generated Code
  23. 36:50Code Generation Example
  24. 40:23Add your own!
  25. 42:11Some drawbacks..
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.