Either library
$ dotnet add package Wrap.EitherVarious monads (including Maybe - see here) for C# - to handle null values and exceptions better - including Linq support, chaining, and asynchronous programming. Includes:
Either<TLeft, TRight>Monad<T>Id<T> (support for int, uint, long, ulong and Guid value types)Maybe<T> (either: Some<T> or None)Result<T> (either: Ok<T> or Failure)View the Wiki for documentation.
Although this library is at v1, it brings together some mature projects I have been working on since 2019. It started with a Result<T> implementation which morphed into Maybe - which reached v10 in November 2025 - and I figured it would be best to have both.
At the same time I was maintaining a StrongId library - which reached v8.5 in November 2024 - to avoid using primitives for Entity IDs. I realised the similarities between Result<T>, Maybe<T> and Id<T> and decided to bring them all together in one library: Wrap.
Copyright (c) 2019-2026 bfren (unless otherwise stated)