mcintyre321/OneOf
Easy to use F#-like ~discriminated~ unions for C# with exhaustive compile time matching observed · 2026-08-28
Health v2 · maintenance only
71/100
- Activity 87
- Release rhythm 35
- Longevity 100
Flags: no_releases
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: n/a
- age_days: 3886
- days_rel: n/a
- days_push: 83
- n_releases_24m: 0
Adoption not part of the score
4054 stars · 164 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
OneOf is a C# library providing F#-style discriminated unions via a generic OneOf<T0,...,Tn> type with exhaustive compile-time matching. It lets methods return strongly typed alternative outcomes without exceptions or base-class hierarchies.
Use cases
- return multiple typed results from a c# method
- avoid exceptions for control flow
- implement option/maybe types in c#
- exhaustive compile-time checked switch handling
- model success or error outcomes with strong types
When to choose
- you write C# and want F#-like discriminated unions
- you want method signatures that force callers to handle every outcome
- you want to replace exception-based control flow with typed error values
When to avoid
- you work outside the .NET ecosystem
- your team prefers traditional polymorphism or exception handling
- you need runtime-open unions with dynamically extensible cases
Facets
library · maturity active
type-system error-handling programming-languages developer-tools dotnet cross-platform discriminated-unions csharp result-types pattern-matching functional-programming
1 source
- readme: https://github.com/mcintyre321/OneOf · fetched 2026-08-28 · 6d02ea4fba6e
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| mcintyre321/OneOf | main | 71 |
For agents
markdown · JSON · MCP: product_card(name="mcintyre321/OneOf")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem