Introduction
An Algebraic Effects System for Golang.
API surface is very much in flux and evolving.
New effects will be added as they are discovered to be useful in the golang ecosystem.
How are Algebraic Effects useful?
Algebraic Effects are useful because they allow programs to be expressed not only in terms of what kind of value they can compute but also on what possible side-effects or external resources will such a computation require.
By using Effect Handlers, the interpretation of how an effect is performed is independent of the program description. This means that a single program description can be interpreted in different ways. For example, using a test-handler that mocks request to external services, or using a live-handler that actually performs such requests.
If you want to read more about different language implementations and theory behind effects, read the effects-bibliography.
Fx.go
is inspired by the following two implementations, and uses a similar notion of the Handler, Ability, and Effect concepts:
- Unison Abilities
- Kyo (Scala3) - special thanks to @fbrasisil, Kyo's author who kindly provided a minimal kyo-core that helped me understand algebraic effect systems and inspired this library.
However, Fx.go
has a different surface API since we are trying to provide the best dev-experience for Golang programmers.