# IBM/fp-go

Functional programming library for Go 1.24+, inspired by fp-ts. Uses generic type aliases for a clean, composable API. Provides Option, Either, Result, IO, IOResult, Reader, and ReaderIOResult monads, plus optics (Lens, Prism, Traversal) for immutable data manipulation. Supports Functor, Applicative, and Monad abstractions with do-notation-style

Repository: https://github.com/IBM/fp-go
Canonical: https://ross.abutalabs.com/products/fp-go
Homepage: https://github.com/IBM/fp-go/tree/main/v2
Language: Go
License: Apache-2.0
License Family: permissive
Topics: functional-programming, go, golang, library, monad, utility
Last push: 2026-08-20T00:38:26+00:00

## Health v2 (maintenance only)
Score: 91/100 (v2, computed 2026-09-03T02:39:23.370411+00:00)
- activity 98, release rhythm 86, longevity 82
- inputs: {"age_days": 1155, "days_push": 14, "days_rel": 17, "gap_med": 0.0, "n_releases_24m": 321}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2020, forks 82 (observed 2026-08-28T04:06:06.283277+00:00)

## What it is
IBM/fp-go is a functional programming library for Go 1.24+ inspired by fp-ts, providing monads like Option, Either, Result, IO, and Reader, plus optics such as Lens, Prism, and Traversal. It leverages generic type aliases to offer a clean, composable API for pure functions and side-effect isolation.

## Use cases
- handle errors functionally in Go with Either and Result types
- isolate side effects using IO monads in Go code
- compose pure functions with pipe and monadic operations
- manipulate immutable data structures with lenses and prisms
- write testable Go code with functional patterns
- use Functor, Applicative, and Monad abstractions in Go

## When to choose
- you want fp-ts-style functional programming idioms in Go
- your project uses Go 1.24+ and benefits from generics-based abstractions
- you need explicit error handling and side-effect isolation for maintainable, testable code

## When to avoid
- your team prefers idiomatic imperative Go without functional abstractions
- you need a stable, non-breaking API - the library is marked work-in-progress with possible breaking changes
- your codebase targets Go versions earlier than 1.24

## Facets
- artifact type: library
- maturity: active
- function: error-handling, concurrency, developer-tools
- domain: programming-languages, developer-tools
- platform: go, cross-platform
- tags: functional-programming, monads, optics, fp-ts, generics, immutability, do-notation, algorithms

## Member repositories
- IBM/fp-go (main) score 91

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:06.283277+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:00:13.208909+00:00, confidence not recorded.
  - readme: https://github.com/IBM/fp-go (fetched 2026-08-28T04:06:06.283277+00:00, sha 09d0839d99fb)
  - homepage: https://github.com/IBM/fp-go/tree/main/v2 (fetched 2026-08-29T10:40:09.229522+00:00, sha 9e90026a4fb2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
