DEV Community

Aaron Pina
Aaron Pina

Posted on

QuickResult: A Lightweight Result Monad with Full LINQ Query Syntax (Zero Dependencies)

I spent years writing monadic code under Paul Louth (the creator of language-ext) and got completely spoiled by how natural LINQ query syntax feels when working with Result types.

When I moved on, I tried the popular options: FluentResults, ErrorOr, OneOf, but they all felt too heavy for everyday work. They force you into opinionated error objects, lots of boilerplate, or awkward chaining.

So I built QuickResult, a dead-simple, zero-dependency Result monad that gives you exactly what I missed.

Why QuickResult feels different

  • Full LINQ query syntax (works with sync, async, and mixed pipelines in one expression)
  • Error is just a plain string (super easy to serialise at API boundaries or log)
  • Zero dependencies, .NET 8+
  • Tons of practical helper extensions for real-world use

Here’s what a mixed sync/async pipeline actually looks like:

var query = from a in Result.Success(4)   // sync
            from b in GetValueAsync(6)    // async
            from c in Result.Success(2)   // sync
            select a + b + c;
var result = await query; // Success(12)
Enter fullscreen mode Exit fullscreen mode

Clean. Readable. No .Bind() hell.

Other helpers I added because I actually use them

WhenNull, FailIfTrue / FailIfFalse
Fallback with the | operator
Try for exception-prone code
ToResult extensions for common types

The philosophy

I deliberately kept the error type simple. No giant Error class you have to serialise at the edges of your API. If you ever need something richer later, you can easily wrap it, but for 90% of services and validation workflows, a clear string is perfect.

v1.8 is now stable and feature-complete. I used functional style heavily in my previous roles and this library brings that same clean, explicit error handling back without any of the ceremony.

Give it a spin

NuGet: https://www.nuget.org/packages/QuickResult
GitHub: https://github.com/aaroncpina/QuickResult

Would love honest feedback or PRs. If there’s a common use-case I missed, let me know! Happy to add more extensions.

(And yes, I know native unions are coming in a future C# version. QuickResult is the practical bridge you can use today while we wait.)

Top comments (0)