# samber/mo

🦄  Monads and popular FP abstractions, powered by Go 1.18+ Generics (Option, Result, Either...)

Repository: https://github.com/samber/mo
Canonical: https://ross.abutalabs.com/products/mo
Homepage: https://pkg.go.dev/github.com/samber/mo
Language: Go
License: MIT
License Family: permissive
Topics: cats, either, fp, functional, future, generics, go, golang, io, maybe, monad, monoid, option, optional, programming, result, state, task, typesafe
Last push: 2026-08-24T23:13:11+00:00

## Health v2 (maintenance only)
Score: 90/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 74, longevity 100
- inputs: {"age_days": 1569, "days_push": 9, "days_rel": 92, "gap_med": 59.5, "n_releases_24m": 5}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3403, forks 118 (observed 2026-08-28T04:08:02.958690+00:00)

## What it is
samber/mo is a Go library providing monads and functional programming abstractions such as Option, Result, Either, Future, IO, Task, and State, built on Go 1.18+ generics. It enables type-safe, composable error handling and functional pipelines with no dependencies beyond the Go standard library.

## Use cases
- handle optional values without nil checks in Go
- model errors as values with Result types in Go
- use Either types for error handling in Go
- compose functional pipelines with map and flatMap in Go
- represent async computations with Future and Task in Go
- avoid nil pointer errors using Option/Maybe types
- write functional-style code in Go with generics

## When to choose
- you want Rust/Scala-style Option and Result semantics in Go
- your team prefers explicit, type-safe error handling over error tuples
- you need composable transformations for optional or fallible values
- you want a dependency-free, SemVer-stable FP library

## When to avoid
- your codebase follows idiomatic Go error-return conventions and the team is unfamiliar with FP
- you need full monad transformer stacks or advanced FP features not provided here
- you are on Go versions older than 1.18 without generics support

## Facets
- artifact type: library
- maturity: stable
- function: error-handling, concurrency, developer-tools
- domain: developer-tools, programming-languages
- platform: go, cross-platform
- tags: monads, functional-programming, generics, option-type, result-type, either, task, future, state-monad, algorithms

## Member repositories
- samber/mo (main) score 90

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:02.958690+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-29T18:38:38.180866+00:00, confidence not recorded.
  - readme: https://github.com/samber/mo (fetched 2026-08-28T04:08:02.958690+00:00, sha a5a7c2630cb7)
  - homepage: https://pkg.go.dev/github.com/samber/mo (fetched 2026-08-29T09:32:45.214017+00:00, sha 8b1286f6fcb2)
  - site_page: https://pkg.go.dev/about (fetched 2026-08-29T09:32:45.218559+00:00, sha 757852027879)
  - site_page: https://pkg.go.dev/github.com/samber/mo/option (fetched 2026-08-29T09:32:45.220506+00:00, sha cf3027c8e558)
  - site_page: https://pkg.go.dev/github.com/samber/mo/result (fetched 2026-08-29T09:32:45.222173+00:00, sha 6aff70e3d64e)
  - site_page: https://pkg.go.dev/github.com/samber/mo/either (fetched 2026-08-29T09:32:45.223854+00:00, sha edf6d3711f3e)
  - site_page: https://pkg.go.dev/github.com/samber/mo/either3 (fetched 2026-08-29T09:32:45.225632+00:00, sha 9ae34c39462d)
  - site_page: https://pkg.go.dev/github.com/samber/mo/either4 (fetched 2026-08-29T09:32:45.227615+00:00, sha 895031df8eee)
  - site_page: https://pkg.go.dev/github.com/samber/mo/either5 (fetched 2026-08-29T09:32:45.229680+00:00, sha c7f82112f91b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
