https://github.com/bfren/wrap
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bfren/wrap
- Owner: bfren
- License: mit
- Created: 2023-08-02T17:42:36.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2026-01-21T21:11:38.000Z (5 months ago)
- Last Synced: 2026-01-22T10:01:10.678Z (5 months ago)
- Language: C#
- Size: 52.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Wrap Monads (C#)
 [](https://www.nuget.org/packages/wrap/) [](https://mit.bfren.dev/2019)
[](https://github.com/bfren/wrap/actions/workflows/test.yml) [](https://github.com/bfren/wrap/actions/workflows/publish.yml) [](https://app.codacy.com/gh/bfren/wrap/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
Various monads (including Maybe - see [here](https://en.wikipedia.org/wiki/Monad_(functional_programming)#An_example:_Maybe)) for C# - to handle null values and exceptions better - including Linq support, chaining, and asynchronous programming. Includes:
- `Either`
- `Monad`
- `Id` (support for `int`, `uint`, `long`, `ulong` and `Guid` value types)
- `Maybe` (either: `Some` or `None`)
- `Result` (either: `Ok` or `Failure`)
View the [Wiki](https://github.com/bfren/wrap/wiki) for documentation.
## History
Although this library is at v1, it brings together some mature projects I have been working on since 2019. It started with a Result 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, Maybe and Id and decided to bring them all together in one library: Wrap.
## Licence
> [MIT](https://mit.bfren.dev/2019)
## Copyright
> Copyright (c) 2019-2026 [bfren](https://bfren.dev) (unless otherwise stated)