Go 1.27+ · 8 standalone modules · Zero dependencies

Small, focused Go librariesfor generic methods and iterators.

Functional containers, lazy collections, structured errors, dependency injection, caching, reactive streams, and slog extensions. Each relies only on the standard library. Examples come from source, with output verified by go test.

MIT licensepkg.go.dev API reference

Option · Unwrap an optional value with a fallback

ports := map[string]string{"http": "80"}

port, ok := ports["https"]
fmt.Println(fp.OptionOf(port, ok).Or("443"))
Output443
Terminal
$ go test -run Example
ok  github.com/luminyra/fp

Libraries

Each library is a standalone Go module. Import only what you need.

Data processing

Option, Result, and Either with generic methods for chaining across types.

go get github.com/luminyra/fp

Lazy, chainable Seq and collection helpers that complement slices, maps, and iter.

go get github.com/luminyra/coll

Errors and logging

Structured errors for log/slog with typed keys, stack traces, and panic recovery.

go get github.com/luminyra/errs

Failover, routing, middleware, attribute formatting, sampling, and HTTP logging for log/slog.

go get github.com/luminyra/sl

Application architecture

Type-safe dependency injection with resolution by type and shutdown in reverse construction order.

go get github.com/luminyra/ioc

In-memory caching with LRU, LFU, FIFO, jittered TTLs, batch loading, and background refresh.

go get github.com/luminyra/memo

Retries, circuit breakers, and timeouts for calls to dependencies, nested as closures with errors returned unchanged.

go get github.com/luminyra/resil

ReactiveX-style streams with chainable operators, range iteration, and context support.

go get github.com/luminyra/rx

Shared features

Go 1.27+
Generic methods let each step in a chain change the value type.
Zero dependencies
Each library depends only on the Go standard library and can be installed on its own.
Iterators
Collections and reactive streams work with iter.Seq and can be consumed with range.
Source examples
Examples come from the libraries’ source code. Test example output is checked by go test.

Start with one library

Run your first example in a few minutes with a quickstart, then explore the guides.