Great article - really enjoyed reading this.
The comparison between the library approach (fp-go) and the language-level approach (GALA) to bringing functional programming into Go is very insightful. The examples around Option pipelines, Either error handling, and collection transformations clearly show how Go’s syntax introduces verbosity when FP patterns are implemented purely as libraries.
I especially liked the discussion around type annotations, Pipe functions, and the signal-to-noise ratio in fp-go versus the cleaner method chaining, lambda inference, and pattern matching in GALA. The side-by-side examples make the trade-offs very clear.
It’s interesting to see how fp-go proves that FP abstractions can work in Go, while GALA explores what happens when those ideas are supported at the language level instead of through libraries.
Really thoughtful breakdown of the design tension between staying within Go’s ecosystem vs improving developer ergonomics for FP-heavy codebases.
Congratulations on this awesome article and kudos for the development of GALA. I think you are spot on pinpointing the challenges one faces when trying to apply functional patterns to pure go. In particular the lack of function overloading that leads to PipeXXX in fp-go is a real pain point. And so is the limitted types system. Go 1.24 has made a significant step forward by allowing type aliases for generic types. This makes switching between monads much simpler.
As the author of fp-go I would like to point out that the syntax of the fp-go examples can be simplified.
For example instead of
I would write
Actually in the spirit of the library I would avoid writing a pipeline but rather a new function that implements the pipeline and that can then be reused and composed like this:
As a bonus such a function can be unit tested.
Thanks for your splendid work and for spreading the idea of functional patterns across the go community!
Carsten