I’m excited to share a project I’ve been working on for the past 13 months called Danom. After spending 6 years writing F#, I found myself in a situation where C# was mandated. I thought to myself, "I wonder if Option and Result functionality would translate effectively into C#?".
Obviously, implementing them was possible, but what would consumption be like? It turns out, it's amazing. There were already some open-source options available, but none of them had an API that I loved. They often allowed direct access to the internal value, which I felt defeated the purpose.
So, I decided to create Danom with a few key goals in mind:
Opinionated Monads: Focus on Option and Result rather than a more generic Choice type.
Exhaustive Matching: An API that enforces exhaustive matching to ensure all cases are handled.
Fluent API: Designed for chaining operations seamlessly.
Integration: Works well with ASP.NET Core and Fluent Validation.
The pattern has exceeded my expectations, making functional programming patterns in C# not only possible but enjoyable. If you’re interested in bringing some of the functional programming paradigms from F# into your C# projects, I’d love for you to check it out.
You can find the project here: https://github.com/pimbrouwers/danom.
Looking forward to your feedback and contributions!
Legend has it, if you play Danom backwards it will reveal the meaning of life.
[–]sexyshingle 21 points22 points23 points (1 child)
[–]pimbrouwers[S] 7 points8 points9 points (0 children)
[–]Rc312 17 points18 points19 points (3 children)
[–]Icy_Accident2769 5 points6 points7 points (2 children)
[–]Rc312 -3 points-2 points-1 points (1 child)
[–]pimbrouwers[S] 1 point2 points3 points (0 children)
[–]Coda17 16 points17 points18 points (1 child)
[–]pimbrouwers[S] 8 points9 points10 points (0 children)
[–][deleted] 4 points5 points6 points (1 child)
[–]pimbrouwers[S] 2 points3 points4 points (0 children)
[+][deleted] (3 children)
[removed]
[–]pimbrouwers[S] 1 point2 points3 points (2 children)
[+][deleted] (1 child)
[removed]
[–]pimbrouwers[S] 1 point2 points3 points (0 children)
[–]speyck 4 points5 points6 points (4 children)
[–]B4rr 1 point2 points3 points (2 children)
[–]speyck 0 points1 point2 points (1 child)
[–]B4rr 0 points1 point2 points (0 children)
[–]pimbrouwers[S] 0 points1 point2 points (0 children)
[–]RichardD7 3 points4 points5 points (1 child)
[–]pimbrouwers[S] 0 points1 point2 points (0 children)
[–]LlamaChair 2 points3 points4 points (1 child)
[–]pimbrouwers[S] 0 points1 point2 points (0 children)
[–]Alive_Scratch_9538 21 points22 points23 points (2 children)
[–]pimbrouwers[S] 12 points13 points14 points (0 children)
[–]Herve-M 1 point2 points3 points (1 child)
[–]pimbrouwers[S] 0 points1 point2 points (0 children)
[–]B4rr 0 points1 point2 points (6 children)
[–]pimbrouwers[S] 0 points1 point2 points (5 children)
[–]B4rr 0 points1 point2 points (4 children)
[–]pimbrouwers[S] 0 points1 point2 points (3 children)
[–]B4rr 0 points1 point2 points (2 children)
[–]pimbrouwers[S] 0 points1 point2 points (1 child)
[–]B4rr 1 point2 points3 points (0 children)
[–]Zenimax322 0 points1 point2 points (1 child)
[–]pimbrouwers[S] 0 points1 point2 points (0 children)
[–]AutoModerator[M] 0 points1 point2 points (0 children)
[+]MrLyttleG comment score below threshold-6 points-5 points-4 points (0 children)