01
Fast & idiomatic
Generics-native. No reflection, no runtime cost. Feels like plain Go.
Learn moreA practical, generics-powered toolkit for writing typed, composable Go. Zero dependencies. Production ready.
Generics-native. No reflection, no runtime cost. Feels like plain Go.
Learn moreOption, Either, Result, Try — full inference. Never interface{} again.
Learn morePipe, compose, fold. Build readable pipelines from one-screen functions.
Learn morePowers data pipelines at IBM and beyond. 95% coverage, fuzz-tested.
Learn moreReplace if err != nil ladders with typed flows. Compose small, total functions into pipelines that are easy to read, refactor, and test.
package main
import (
"fmt"
"strings"
F "github.com/IBM/fp-go/v2"
O "github.com/IBM/fp-go/v2/option"
)
// Parse → validate → format. Total, typed, nil-safe.
func greet(raw string) string {
return F.Pipe3(
O.FromString(raw),
O.Filter(func(s string) bool {
return len(s) > 1
}),
O.Map(strings.Title),
O.GetOrElse(F.Constant("friend")),
)
}
func main() {
fmt.Println("Hello, " + greet("ada"))
// → Hello, Ada
}