Repository navigation
2.0.0 (2026-11-12)
Highlights
A ground-up rewrite for .NET 11 and C# 15 unions. The 1.x line is retired.
Maybe<T>is a C# 15 union with exactly two cases,TandNone: values convert implicitly, aswitchover
both is exhaustive, and pattern matching works in generic code too.- No invalid states:
default(Maybe<T>)isNone, anullnever becomes a value, and there is no.Valueor
any other throwing accessor. - Functional API:
Match,OrDefault,Map,Bind,Filter,OrElse,Zip,Fold,Iter,Tap,
Flatten, and query syntax (from,where,let,select). - Collections and interop:
Choose,Traverse,Sequence,FirstOrNone,SingleOrNone,GetValueOrNone,
FromNullable,ToNullableandMaybe.Parse<T>. - Ordering like
Optionin F# (Nonefirst), with no</>operators on purpose. System.Text.Jsonwithout configuration: a value is written as itself andNoneasnull. Works with
source-generated contexts.- Async:
*Asynccounterparts returningValueTask, plus pipelines and query syntax overTask<Maybe<T>>and
ValueTask<Maybe<T>>with a singleawait. - Zero allocations for value-type
T(checked on every build); trimming and Native AOT compatible. - Requires .NET 11.
Performance Improvements
- allocate nothing in async queries with two
fromclauses (590045a)