Functional.DotNet
1.0.4
See the version list below for details.
dotnet add package Functional.DotNet --version 1.0.4
NuGet\Install-Package Functional.DotNet -Version 1.0.4
<PackageReference Include="Functional.DotNet" Version="1.0.4" />
paket add Functional.DotNet --version 1.0.4
#r "nuget: Functional.DotNet, 1.0.4"
// Install Functional.DotNet as a Cake Addin
#addin nuget:?package=Functional.DotNet&version=1.0.4
// Install Functional.DotNet as a Cake Tool
#tool nuget:?package=Functional.DotNet&version=1.0.4
Functional.DotNet
Installation
To start using Functional.DotNet in your C# projects, install the package from NuGet:
- Using Package Manager:
Install-Package Functional.DotNet -Version 1.0.4
- Using .NET CLI:
dotnet add package Functional.DotNet --version 1.0.4
Introduction
Welcome to Functional.DotNet, a framework designed to enhance the functional programming experience in C#. Inspired by functional programming principles, this toolset enables developers to write more efficient, readable, and maintainable C# code.
Why Choose Functional.DotNet?
- Ease of Use: Intuitive design, making functional programming in C# accessible for all levels.
- Enhanced Code Quality: Promotes writing predictable, less error-prone code.
- Seamless Integration: Integrates smoothly with existing C# projects.
Documentation
For a comprehensive guide on how to integrate and utilize Functional.DotNet in your C# projects, please refer to our official documentation.
Getting Started
Refer to our documentation for details on integrating and using this framework in your C# projects.
Learning Resources
For beginners, check out my book "Functional C#: Embracing Functional Programming in a C# World", a great resource for understanding C# functional programming.
Features and Code Samples
Using Try
// Example of using Try for exception-safe code
Try<Uri> CreateUri(string uri) => () => new Uri(uri);
var uriTry = CreateUri("http://github.com");
uriTry.Run().Match(
Success: uri => Assert.NotNull(uri),
Exception: ex => Fail()
);
Working with Option
// Example of using Option to handle optional values
Option<User> userOption = GetUserById(userId);
userOption.Match(
Some: user => Console.WriteLine("User found: " + user.Name),
None: () => Console.WriteLine("User not found"));
Understanding Monads
In Functional.DotNet, we delve into the concept of monads, such as Try and Option, to handle various computational contexts in a more functional way.
Contributing
Based on Enrico Buonanno's la-yumba/functional-csharp-code-2, Functional.DotNet extends these concepts to provide a comprehensive functional programming experience in C#.
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.